ColorPicker icon indicating copy to clipboard operation
ColorPicker copied to clipboard

HsvProps Issues

Open jamsoft opened this issue 1 year ago • 4 comments

I just cloned the repo to start trying to investigate this issue:

https://github.com/wieslawsoltes/ColorPicker/issues/22

When I launch the ColorPickerDemo project from within VS it immediately crashes in

private static bool ValidateSaturation(double? saturation)
{
    if (saturation is null)
    {
        return true;
    }
    if (saturation < 0.0 || saturation > 100.0)
    {
        throw new ArgumentException("Invalid Saturation value.");
    }
    return true;
}

The input saturation value is "100.00000000000001".

jamsoft avatar Aug 13 '22 11:08 jamsoft

If I try to run ThemeEditor.Desktop it also crashes as it cannot find the Deafult Theme to load.

If I try to run the Web project it also bombs as no inputs.

I have run the Nuke build too.

jamsoft avatar Aug 13 '22 11:08 jamsoft

So to just get the demo up and running I deleted the throw new ... ... that got the demo running which doesn't seem to have the same problem as the instance in my application. So still investigating that.

If I click on the Alpha or HSV or CMYK tabs the demo app immediately bombs with:

System.InvalidCastException: 'Unable to cast object of type 'Avalonia.UnsetValueType' to type 'System.Nullable`1

If I drag the Alpha thumb to the far right and then resize the app it also bombs on throw new ArgumentException("Invalid Alpha value.");

As the alpha value being sent to the method is 100.00000000000001.

Before seeing this behaviour I had already started to think it was something to do with the translation of values from screen points to the UI/mouse position calculations. I think this screen resizing bombing is in agreement as it seems to try to update the associated values before recalculating the potential min max values during the redraw.

jamsoft avatar Aug 13 '22 11:08 jamsoft

@jamsoft Can you try again master branch, I have pushed some changes

wieslawsoltes avatar Aug 13 '22 13:08 wieslawsoltes

That definitely has improved things but dragging the Alpha thumb to the far right is still passing 100.000000001 and crashing things.

jamsoft avatar Aug 13 '22 16:08 jamsoft

Can't do more

wieslawsoltes avatar Apr 13 '23 10:04 wieslawsoltes