mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 05:50:10 +00:00
textlayout: Clip selection bounds to the line extents
The rest of the line will be painted separately.
This commit is contained in:
parent
167134e1a8
commit
70ee86c951
@ -3951,6 +3951,17 @@ render_para (GskPangoRenderer *crenderer,
|
||||
bounds.size.width = PANGO_PIXELS (ranges[2*i + 1]) - PANGO_PIXELS (ranges[2*i]);
|
||||
bounds.size.height = selection_height;
|
||||
|
||||
if (bounds.origin.x < PANGO_PIXELS (line_rect.x))
|
||||
{
|
||||
bounds.size.width -= PANGO_PIXELS (line_rect.x) - bounds.origin.x;
|
||||
bounds.origin.x = PANGO_PIXELS (line_rect.x);
|
||||
}
|
||||
|
||||
bounds.size.width = MIN (bounds.size.width,
|
||||
PANGO_PIXELS (line_rect.x) +
|
||||
PANGO_PIXELS (line_rect.width) -
|
||||
bounds.origin.x);
|
||||
|
||||
gtk_snapshot_append_color (crenderer->snapshot, selection, &bounds);
|
||||
|
||||
if (draw_selection_text)
|
||||
|
Loading…
Reference in New Issue
Block a user