diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-01-11 22:51:23 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-01-11 22:51:23 +0100 |
| commit | 09fe8a3411ec7cc26cba2c16cecf48a7be4522ce (patch) | |
| tree | 07564186c24c5f1c7632dcf7fec117ab7898ae5f | |
| parent | d95211bd43a7948751fcbddbb115d1dd551f8943 (diff) | |
Fix markers view for RTL languages (part of #2696).
| -rw-r--r-- | src/wx/markers_panel.cc | 18 |
1 files 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(); } } |
