|
@@ -1196,7 +1196,9 @@ void Polygon2DEditor::_uv_draw() {
|
|
|
|
|
|
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;
|
|
|
|
+
|
|
updating_uv_scroll = true;
|
|
updating_uv_scroll = true;
|
|
|
|
+
|
|
uv_hscroll->set_min(rect.position.x);
|
|
uv_hscroll->set_min(rect.position.x);
|
|
uv_hscroll->set_max(rect.position.x + rect.size.x);
|
|
uv_hscroll->set_max(rect.position.x + rect.size.x);
|
|
if (ABS(rect.position.x - (rect.position.x + rect.size.x)) <= uv_edit_draw->get_size().x) {
|
|
if (ABS(rect.position.x - (rect.position.x + rect.size.x)) <= uv_edit_draw->get_size().x) {
|
|
@@ -1216,6 +1218,14 @@ void Polygon2DEditor::_uv_draw() {
|
|
uv_vscroll->set_page(uv_edit_draw->get_size().y);
|
|
uv_vscroll->set_page(uv_edit_draw->get_size().y);
|
|
uv_vscroll->set_value(uv_draw_ofs.y);
|
|
uv_vscroll->set_value(uv_draw_ofs.y);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ Size2 hmin = uv_hscroll->get_combined_minimum_size();
|
|
|
|
+ Size2 vmin = uv_vscroll->get_combined_minimum_size();
|
|
|
|
+
|
|
|
|
+ // Avoid scrollbar overlapping.
|
|
|
|
+ uv_hscroll->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, uv_vscroll->is_visible() ? -vmin.width : 0);
|
|
|
|
+ uv_vscroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, uv_hscroll->is_visible() ? -hmin.height : 0);
|
|
|
|
+
|
|
updating_uv_scroll = false;
|
|
updating_uv_scroll = false;
|
|
}
|
|
}
|
|
|
|
|