From 09fe8a3411ec7cc26cba2c16cecf48a7be4522ce Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 11 Jan 2024 22:51:23 +0100 Subject: Fix markers view for RTL languages (part of #2696). --- src/wx/markers_panel.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/wx/markers_panel.cc b/src/wx/markers_panel.cc index dcd056318..baf221f3e 100644 --- a/src/wx/markers_panel.cc +++ b/src/wx/markers_panel.cc @@ -211,11 +211,23 @@ MarkersPanel::paint () line.MoveToPoint (pos, 0); line.AddLineToPoint (pos, panel_height); gc->StrokePath (line); - if (marker.second.line_before_label) { - gc->DrawText (label, pos + line_to_label_gap, 0); + + auto label_x = 0; + + if (GetLayoutDirection() == wxLayout_RightToLeft) { + auto matrix = dc.GetTransformMatrix(); + matrix.Translate(0, 0); + matrix.Mirror(wxHORIZONTAL); + dc.SetTransformMatrix(matrix); + label_x = marker.second.line_before_label ? (pos + line_to_label_gap + marker.second.width) : (pos - line_to_label_gap); + label_x = -label_x; } else { - gc->DrawText (label, pos - line_to_label_gap - marker.second.width, 0); + label_x = marker.second.line_before_label ? (pos + line_to_label_gap) : (pos - line_to_label_gap - marker.second.width); } + + gc->DrawText(label, label_x, 0); + + dc.ResetTransformMatrix(); } } -- cgit v1.2.3