diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-21 22:25:23 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-21 22:25:23 +0200 |
commit | 78b9c04d7f878bf5b848e55a1729fb81af9219ea (patch) | |
tree | be4a1d10256912016c9c7fbc48fdad367f0762f0 | |
parent | 73faede0ce49a06e117971e75bfe8fb30ec937ca (diff) |
DocumentWidget: Drawing marks with better bounds
-rw-r--r-- | src/ui/documentwidget.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index a10aa409..d7d15a67 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -2317,7 +2317,7 @@ static void fillRange_DrawContext_(iDrawContext *d, const iGmRun *run, enum iCol | |||
2317 | if (!*isInside) { | 2317 | if (!*isInside) { |
2318 | x = advanceRange_Text(run->font, (iRangecc){ run->text.start, mark.start }).x; | 2318 | x = advanceRange_Text(run->font, (iRangecc){ run->text.start, mark.start }).x; |
2319 | } | 2319 | } |
2320 | int w = width_Rect(run->bounds) - x; | 2320 | int w = width_Rect(run->visBounds) - x; |
2321 | if (contains_Range(&run->text, mark.end) || run->text.end == mark.end) { | 2321 | if (contains_Range(&run->text, mark.end) || run->text.end == mark.end) { |
2322 | w = advanceRange_Text(run->font, | 2322 | w = advanceRange_Text(run->font, |
2323 | !*isInside ? mark : (iRangecc){ run->text.start, mark.end }).x; | 2323 | !*isInside ? mark : (iRangecc){ run->text.start, mark.end }).x; |
@@ -2326,8 +2326,8 @@ static void fillRange_DrawContext_(iDrawContext *d, const iGmRun *run, enum iCol | |||
2326 | else { | 2326 | else { |
2327 | *isInside = iTrue; /* at least until the next run */ | 2327 | *isInside = iTrue; /* at least until the next run */ |
2328 | } | 2328 | } |
2329 | if (w > width_Rect(run->bounds) - x) { | 2329 | if (w > width_Rect(run->visBounds) - x) { |
2330 | w = width_Rect(run->bounds) - x; | 2330 | w = width_Rect(run->visBounds) - x; |
2331 | } | 2331 | } |
2332 | const iInt2 visPos = | 2332 | const iInt2 visPos = |
2333 | add_I2(run->bounds.pos, addY_I2(d->viewPos, -value_Anim(&d->widget->scrollY))); | 2333 | add_I2(run->bounds.pos, addY_I2(d->viewPos, -value_Anim(&d->widget->scrollY))); |