diff options
Diffstat (limited to 'client')
| -rw-r--r-- | client/gui/menus/book/book.gd | 4 | ||||
| -rw-r--r-- | client/gui/menus/book/diagram.gd | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/client/gui/menus/book/book.gd b/client/gui/menus/book/book.gd index b9479bdd..f6d95c8a 100644 --- a/client/gui/menus/book/book.gd +++ b/client/gui/menus/book/book.gd @@ -39,6 +39,9 @@ func _ready(): super() book_data = data pages = book_data.data["pages"] + # Flip book for rtl languages + $Margin/HBoxContainer/Previous.flip_h = not is_layout_rtl() + $Margin/HBoxContainer/Next.flip_h = is_layout_rtl() build_page() func build_page() -> void: @@ -83,6 +86,7 @@ func build_paragraph(m: String) -> Label: label.add_theme_font_override("font", preload("res://gui/resources/fonts/font-josefin-sans.woff2")) label.add_theme_font_size_override("font_size", 32) label.add_theme_color_override("font_color", Color.BLACK) + label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART label.text = m return label diff --git a/client/gui/menus/book/diagram.gd b/client/gui/menus/book/diagram.gd index 09dd03d1..65209c64 100644 --- a/client/gui/menus/book/diagram.gd +++ b/client/gui/menus/book/diagram.gd @@ -54,7 +54,8 @@ func _init(raw_: Dictionary, game: Game) -> void: func _ready() -> void: redraw_images() item_rect_changed.connect(func(): - scale(Rect2(Vector2(HSIZE, HSIZE), Vector2(size.x - SIZE, size.y - SIZE))) + if size != Vector2(64, 64): + scale(Rect2(Vector2(HSIZE, HSIZE), Vector2(size.x - SIZE, size.y - SIZE))) ) func redraw_images() -> void: @@ -73,8 +74,6 @@ func redraw_images() -> void: renderers.push_back(r) func scale(bounds: Rect2) -> void: - if bounds.abs() != bounds: - return var current := Rect2(Vector2(INF, INF), Vector2(-INF, -INF)) for n: DiagramNode in draw_nodes: if n.position.x < current.position.x: @@ -85,8 +84,6 @@ func scale(bounds: Rect2) -> void: current.end.x = n.position.x if n.position.y > current.end.y: current.end.y = n.position.y - if bounds.encloses(current): - return var s := bounds.size / current.size for n: DiagramNode in nodes: var p := n.position |