mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
Fix alternating through random colors when picking from the same ColorButton
This commit is contained in:
parent
414165f078
commit
fe1d96ed0e
@ -159,7 +159,12 @@ bool ColorButton::onProcessMessage(Message* msg)
|
||||
gfx::Point screenPos = nativeWindow->pointToScreen(mousePos);
|
||||
|
||||
Widget* picked = manager()->pickFromScreenPos(screenPos);
|
||||
IColorSource* colorSource = (picked != this ? dynamic_cast<IColorSource*>(picked): nullptr);
|
||||
if (picked == this) {
|
||||
// Do nothing
|
||||
break;
|
||||
}
|
||||
|
||||
IColorSource* colorSource = dynamic_cast<IColorSource*>(picked);
|
||||
if (colorSource) {
|
||||
nativeWindow = picked->display()->nativeWindow();
|
||||
mousePos = nativeWindow->pointFromScreen(screenPos);
|
||||
|
@ -96,7 +96,12 @@ bool TileButton::onProcessMessage(Message* msg)
|
||||
|
||||
// Pick a tile from a ITileSource
|
||||
Widget* picked = window()->pick(mousePos);
|
||||
ITileSource* tileSource = (picked != this ? dynamic_cast<ITileSource*>(picked): nullptr);
|
||||
if (picked == this) {
|
||||
// Do nothing
|
||||
break;
|
||||
}
|
||||
|
||||
ITileSource* tileSource = dynamic_cast<ITileSource*>(picked);
|
||||
|
||||
// If there is no tile source in this window, try to get the
|
||||
// tile from other display, i.e. and editor in other native
|
||||
|
Loading…
Reference in New Issue
Block a user