You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Fix position of tile names in TileSet editor when zooming in/out
Fixes #27713.
This commit is contained in:
@@ -1038,8 +1038,10 @@ void TileSetEditor::_on_workspace_overlay_draw() {
|
|||||||
tileset->get_tile_list(tiles);
|
tileset->get_tile_list(tiles);
|
||||||
for (List<int>::Element *E = tiles->front(); E; E = E->next()) {
|
for (List<int>::Element *E = tiles->front(); E; E = E->next()) {
|
||||||
int t_id = E->get();
|
int t_id = E->get();
|
||||||
if (tileset->tile_get_texture(t_id)->get_rid() == current_texture_rid) {
|
if (tileset->tile_get_texture(t_id)->get_rid() != current_texture_rid)
|
||||||
Rect2i region = tileset->tile_get_region(t_id);
|
continue;
|
||||||
|
|
||||||
|
Rect2 region = tileset->tile_get_region(t_id);
|
||||||
region.position += WORKSPACE_MARGIN;
|
region.position += WORKSPACE_MARGIN;
|
||||||
region.position *= workspace->get_scale().x;
|
region.position *= workspace->get_scale().x;
|
||||||
Color c;
|
Color c;
|
||||||
@@ -1058,7 +1060,6 @@ void TileSetEditor::_on_workspace_overlay_draw() {
|
|||||||
workspace_overlay->draw_string(font, region.position, tile_id_name, c);
|
workspace_overlay->draw_string(font, region.position, tile_id_name, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int t_id = get_current_tile();
|
int t_id = get_current_tile();
|
||||||
if (t_id < 0)
|
if (t_id < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user