mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-09 18:44:46 +00:00
Sync colors between the TagWindow color picker <-> user data color picker
This commit is contained in:
parent
be7fa67b61
commit
18454cf5fa
@ -68,13 +68,26 @@ doc::AniDir TagWindow::aniDirValue()
|
|||||||
|
|
||||||
void TagWindow::onPopupUserData()
|
void TagWindow::onPopupUserData()
|
||||||
{
|
{
|
||||||
|
// Required because we are showing the color in the TagWindow so we
|
||||||
|
// have to put the color in the user data before showing the same
|
||||||
|
// color again in the user data tooltip.
|
||||||
|
//
|
||||||
|
// TODO remove this field in the future
|
||||||
|
app::Color c = color()->getColor();
|
||||||
|
m_userData.setColor(doc::rgba(c.getRed(),
|
||||||
|
c.getGreen(),
|
||||||
|
c.getBlue(),
|
||||||
|
c.getAlpha()));
|
||||||
|
|
||||||
if (show_user_data_popup(userData()->bounds(), m_userData)) {
|
if (show_user_data_popup(userData()->bounds(), m_userData)) {
|
||||||
color_t color = m_userData.color();
|
color_t d = m_userData.color();
|
||||||
// Paint the tag properties color picker
|
// And synchronize back the color from the user data with the
|
||||||
app::Color c;
|
// color in the tag properties color picker.
|
||||||
this->color()->setColor(c.fromRgb(int(rgba_getr(color)),
|
color()->setColor(
|
||||||
int(rgba_getg(color)),
|
app::Color::fromRgb(int(rgba_getr(d)),
|
||||||
int(rgba_getb(color)), 255));
|
int(rgba_getg(d)),
|
||||||
|
int(rgba_getb(d)),
|
||||||
|
int(rgba_geta(d))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user