From 03b109a79d511467fabf218b03d8a64bea5a6141 Mon Sep 17 00:00:00 2001 From: Ali Tavakoli Date: Tue, 25 Feb 2025 18:32:33 +0330 Subject: [PATCH] Fix: The value assigned to the text-align property is the opposite To specify the text-align value, the page orientation is taken into account, so if the page orientation is set to RTL, the value assigned to the text-align property will be the opposite, while text-align option operate independently of the page orientation. --- src/Wt/WContainerWidget.C | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Wt/WContainerWidget.C b/src/Wt/WContainerWidget.C index 52a898c4f..391174ad0 100644 --- a/src/Wt/WContainerWidget.C +++ b/src/Wt/WContainerWidget.C @@ -351,16 +351,13 @@ void WContainerWidget::updateDom(DomElement& element, bool all) if (flags_.test(BIT_CONTENT_ALIGNMENT_CHANGED) || all) { AlignmentFlag hAlign = contentAlignment_ & AlignHorizontalMask; - bool ltr = WApplication::instance()->layoutDirection() - == LayoutDirection::LeftToRight; - switch (hAlign) { case AlignmentFlag::Left: if (flags_.test(BIT_CONTENT_ALIGNMENT_CHANGED)) - element.setProperty(Property::StyleTextAlign, ltr ? "left" : "right"); + element.setProperty(Property::StyleTextAlign, "left"); break; case AlignmentFlag::Right: - element.setProperty(Property::StyleTextAlign, ltr ? "right" : "left"); + element.setProperty(Property::StyleTextAlign, "right"); break; case AlignmentFlag::Center: element.setProperty(Property::StyleTextAlign, "center");