← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/RTL-alignment-fix into lp:widelands

 

Arty has proposed merging lp:~widelands-dev/widelands/RTL-alignment-fix into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/RTL-alignment-fix/+merge/358596
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/RTL-alignment-fix into lp:widelands.
=== modified file 'src/ui_basic/textarea.cc'
--- src/ui_basic/textarea.cc	2018-07-08 13:53:45 +0000
+++ src/ui_basic/textarea.cc	2018-11-10 18:48:51 +0000
@@ -125,9 +125,10 @@
  */
 void Textarea::draw(RenderTarget& dst) {
 	if (!text_.empty()) {
+		Align alignment = mirror_alignment(align_, text_);
 		Vector2i anchor(
-		   (align_ == Align::kCenter) ? get_w() / 2 : (align_ == UI::Align::kRight) ? get_w() : 0, 0);
-		rendered_text_->draw(dst, anchor, align_);
+		   (alignment == Align::kCenter) ? get_w() / 2 : (alignment == UI::Align::kRight) ? get_w() : 0, 0);
+		rendered_text_->draw(dst, anchor, alignment);
 	}
 }
 


Follow ups