mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-06 06:58:15 +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);
|
gfx::Point screenPos = nativeWindow->pointToScreen(mousePos);
|
||||||
|
|
||||||
Widget* picked = manager()->pickFromScreenPos(screenPos);
|
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) {
|
if (colorSource) {
|
||||||
nativeWindow = picked->display()->nativeWindow();
|
nativeWindow = picked->display()->nativeWindow();
|
||||||
mousePos = nativeWindow->pointFromScreen(screenPos);
|
mousePos = nativeWindow->pointFromScreen(screenPos);
|
||||||
|
@ -96,7 +96,12 @@ bool TileButton::onProcessMessage(Message* msg)
|
|||||||
|
|
||||||
// Pick a tile from a ITileSource
|
// Pick a tile from a ITileSource
|
||||||
Widget* picked = window()->pick(mousePos);
|
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
|
// If there is no tile source in this window, try to get the
|
||||||
// tile from other display, i.e. and editor in other native
|
// tile from other display, i.e. and editor in other native
|
||||||
|
Loading…
Reference in New Issue
Block a user