-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ColorPicker issues in WASM #5992
Comments
@robloo Any of this rings a bell? Should it work? Not yet implemented? |
@francoistanguay @jsinsel The ColorPicker was only tested to work with Android and iOS at the time. There is a known issue in Uno where image source invalidation doesn't work (at least this is the best theory). If you set an ImageBrush's ImageSource to a new WritableBitmap and then that WritableBitmap is updated asyncronously later, updates will be ignored and won't ever display. This means the color spectrum is never visible in some cases. For some reason correctly handling this source invalidation was only implemented on a few platforms. ImageBrush/ImageSource likely needs a big refactoring on all platforms as this code is inconsistent and quite messy. The issue with the slider backgrounds not being visible may be similar. Although, I've seen evidence there has been regressions with controls derived from Slider. No idea what may be going on with Popup. Personally, I've never worked with the WASM head. Some key pieces of code to look at: Code where the uno/src/Uno.UI/Microsoft/UI/Xaml/Controls/ColorPicker/ColorSpectrum.cs Lines 1158 to 1166 in e1f887c
Code where the uno/src/Uno.UI/Microsoft/UI/Xaml/Controls/ColorPicker/ColorSpectrum.cs Lines 1601 to 1609 in e1f887c
I do not understand fully how changes are propagated by Uno itself. However, Edit: I should add: a new ImageBrush is created and set as Fill each time UpdateBitmapSources() is called so I might be wrong about this being an issue with update propagation as described above. It could also be related to the Shape.Fill property. Anyway, it's been several months since I looked at this and only ported the code to C# so I shouldn't say much about things I don't fully understand. If there are any specific questions related to ColorPicker and debugging this I will be happy to help though. |
fixme:
other issues noticed:
|
I have given up fixing all the related, secondary issues and unsupported features in Uno to get the ColorPicker to work correctly on all platforms. However, I still think the ported code is good and you won't find any issues there (it was well tested on UWP after the C++ -> C# conversion, and then well tested again on Android at the time). If you need help with the ColorPicker code specifically though I will support there. For example, I can take responsibility for number 4 but it will be a while before I get around to it. |
@Xiaoy312 Awesome! Note that there is a bug in the gradient (you might have fixed that already in the PR as you were adjusting code in that area). However, that is the same bug that existed in iOS.
Edit: Added Graphics |
Current behavior
Add a
<ColorPicker>
to any sample project. The following occurs in WASM:Expected behavior
Should be able to see the color spectrum and track bar. Should be able to interact with it even when shown multiple times in a popup.
How to reproduce it (as minimally and precisely as possible)
Attaching a sample project.
App1.Shared.zip
Workaround
Environment
Nuget Package:
Nuget Package Version(s):
Affected platform(s):
IDE:
Relevant plugins:
Anything else we need to know?
The text was updated successfully, but these errors were encountered: