mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Now RectView will also change / zoom the margins.
This commit is contained in:
parent
b45e197d69
commit
ff2579bd04
@ -32,6 +32,13 @@ func apply_zoom() -> void:
|
||||
rect.size = rect.size * _rect_scale
|
||||
set_custom_minimum_size(rect.size)
|
||||
|
||||
var p : MarginContainer = get_parent() as MarginContainer
|
||||
|
||||
p.add_constant_override("margin_left", min(rect.size.x / 4.0, 50 * _rect_scale))
|
||||
p.add_constant_override("margin_right", min(rect.size.x / 4.0, 50 * _rect_scale))
|
||||
p.add_constant_override("margin_top", min(rect.size.y / 4.0, 50 * _rect_scale))
|
||||
p.add_constant_override("margin_bottom", min(rect.size.y / 4.0, 50 * _rect_scale))
|
||||
|
||||
for c in get_children():
|
||||
c.set_editor_rect_scale(_rect_scale)
|
||||
|
||||
@ -54,13 +61,6 @@ func refresh() -> void:
|
||||
rect.size = rect.size * _rect_scale
|
||||
set_custom_minimum_size(rect.size)
|
||||
|
||||
var p : MarginContainer = get_parent() as MarginContainer
|
||||
|
||||
p.add_constant_override("margin_left", min(rect.size.x / 4.0, 50))
|
||||
p.add_constant_override("margin_right", min(rect.size.x / 4.0, 50))
|
||||
p.add_constant_override("margin_top", min(rect.size.y / 4.0, 50))
|
||||
p.add_constant_override("margin_bottom", min(rect.size.y / 4.0, 50))
|
||||
|
||||
apply_zoom()
|
||||
|
||||
refresh_rects()
|
||||
|
Loading…
Reference in New Issue
Block a user