1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Fix Scrollbar range calculation error

When zoomed in, the right and bottom edges of the resource image will be outside the viewing area.
This commit is contained in:
BiBi
2020-12-28 22:49:18 +08:00
committed by GitHub
parent 8f4c4bb610
commit 849a8b5f58

View File

@@ -1052,8 +1052,6 @@ void Polygon2DEditor::_uv_draw() {
if (i < uv_draw_max /*&& polygons.size() == 0 && polygon_create.size() == 0*/) { //if using or creating polygons, do not show outline (will show polygons instead) if (i < uv_draw_max /*&& polygons.size() == 0 && polygon_create.size() == 0*/) { //if using or creating polygons, do not show outline (will show polygons instead)
uv_edit_draw->draw_line(mtx.xform(uvs[i]), mtx.xform(next_point), poly_line_color, Math::round(EDSCALE)); uv_edit_draw->draw_line(mtx.xform(uvs[i]), mtx.xform(next_point), poly_line_color, Math::round(EDSCALE));
} }
rect.expand_to(mtx.basis_xform(uvs[i]));
} }
for (int i = 0; i < polygons.size(); i++) { for (int i = 0; i < polygons.size(); i++) {
@@ -1160,8 +1158,8 @@ void Polygon2DEditor::_uv_draw() {
uv_edit_draw->draw_circle(bone_paint_pos, bone_paint_radius->get_value() * EDSCALE, Color(1, 1, 1, 0.1)); uv_edit_draw->draw_circle(bone_paint_pos, bone_paint_radius->get_value() * EDSCALE, Color(1, 1, 1, 0.1));
} }
rect.position -= uv_edit_draw->get_size(); rect.position = -uv_edit_draw->get_size();
rect.size += uv_edit_draw->get_size() * 2.0; rect.size = uv_edit_draw->get_size() * 2.0 + base_tex->get_size() * uv_draw_zoom;
updating_uv_scroll = true; updating_uv_scroll = true;