diff options
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index c3c0f527..b1c166aa 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -2274,14 +2274,26 @@ static void fillRange_DrawContext_(iDrawContext *d, const iGmRun *run, enum iCol | |||
2274 | else { | 2274 | else { |
2275 | *isInside = iTrue; /* at least until the next run */ | 2275 | *isInside = iTrue; /* at least until the next run */ |
2276 | } | 2276 | } |
2277 | if (w > width_Rect(run->visBounds) - x) { | 2277 | if (w > width_Rect(run->bounds) - x) { |
2278 | w = width_Rect(run->visBounds) - x; | 2278 | w = width_Rect(run->bounds) - x; |
2279 | } | 2279 | } |
2280 | const iInt2 visPos = | 2280 | const iInt2 visPos = |
2281 | add_I2(run->bounds.pos, addY_I2(d->viewPos, -value_Anim(&d->widget->scrollY))); | 2281 | add_I2(run->bounds.pos, addY_I2(d->viewPos, -value_Anim(&d->widget->scrollY))); |
2282 | fillRect_Paint(&d->paint, (iRect){ addX_I2(visPos, x), | 2282 | fillRect_Paint(&d->paint, (iRect){ addX_I2(visPos, x), |
2283 | init_I2(w, height_Rect(run->bounds)) }, color); | 2283 | init_I2(w, height_Rect(run->bounds)) }, color); |
2284 | } | 2284 | } |
2285 | /* Link URLs are not part of the visible document, so they are ignored above. Handle | ||
2286 | these ranges as a special case. */ | ||
2287 | if (run->linkId && run->flags & decoration_GmRunFlag) { | ||
2288 | const iRangecc url = linkUrlRange_GmDocument(d->widget->doc, run->linkId); | ||
2289 | if (contains_Range(&url, mark.start) && | ||
2290 | (contains_Range(&url, mark.end) || url.end == mark.end)) { | ||
2291 | fillRect_Paint( | ||
2292 | &d->paint, | ||
2293 | moved_Rect(run->visBounds, addY_I2(d->viewPos, -value_Anim(&d->widget->scrollY))), | ||
2294 | color); | ||
2295 | } | ||
2296 | } | ||
2285 | } | 2297 | } |
2286 | 2298 | ||
2287 | static void drawMark_DrawContext_(void *context, const iGmRun *run) { | 2299 | static void drawMark_DrawContext_(void *context, const iGmRun *run) { |