mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-06 06:58:15 +00:00
Fix eyedropper when picking tiles from composed image
When eyedropper was used to pick tiles from a composed image having an image layer and a tilemap layer without cels, it tried to pick tiles from the image layer.
This commit is contained in:
parent
079f7b6537
commit
783802a980
@ -134,12 +134,13 @@ void ColorPicker::pickColor(const Site& site,
|
||||
m_layer = cels.front()->layer();
|
||||
|
||||
if (site.tilemapMode() == TilemapMode::Tiles) {
|
||||
if (!cels.empty()) {
|
||||
const gfx::Point tilePos = site.grid().canvasToTile(gfx::Point(pos));
|
||||
if (cels.front()->image()->bounds().contains(tilePos)) {
|
||||
m_tile = doc::get_pixel(cels.front()->image(), tilePos.x, tilePos.y);
|
||||
m_color = app::Color::fromIndex(m_tile);
|
||||
}
|
||||
if (cels.empty() || !cels.front()->image()->isTilemap())
|
||||
return;
|
||||
|
||||
const gfx::Point tilePos = site.grid().canvasToTile(gfx::Point(pos));
|
||||
if (cels.front()->image()->bounds().contains(tilePos)) {
|
||||
m_tile = doc::get_pixel(cels.front()->image(), tilePos.x, tilePos.y);
|
||||
m_color = app::Color::fromIndex(m_tile);
|
||||
}
|
||||
}
|
||||
else if (site.tilemapMode() == TilemapMode::Pixels) {
|
||||
|
Loading…
Reference in New Issue
Block a user