Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 295091 - [rulers] Annotations in overview ruler still not in sync with thumb for big documents
Summary: [rulers] Annotations in overview ruler still not in sync with thumb for big d...
Status: CLOSED DUPLICATE of bug 163769
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 3.7   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-13 13:00 EST by Markus Keller CLA
Modified: 2011-01-13 12:18 EST (History)
1 user (show)

See Also:


Attachments
current state - should be moved into ruler painter (3.03 KB, patch)
2009-11-13 13:00 EST, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2009-11-13 13:00:36 EST
Created attachment 152179 [details]
current state - should be moved into ruler painter

I20091110-0800

Even after the overview ruler area has been aligned with the actual thumb track
area, an annotation in the overview ruler is sometimes still a bit outside the
thumb, even if the annotation is visible in the text area.

A concrete example:
- open StyledText
- add a compile error or a breakpoint around line 9000
- set height of editor such that 15 lines are visible
=> the annotation in the overview ruler is always slightly below the thumb
Similar problem in the beginning of the editor, e.g. for the TODO at line 433.

I think the problem is that the annotations in the overview ruler are just
spread linearly in the whole available thumb track area. The assumption is that
    thumbHeight/thumbTrackHeight == visibleLineCount/textLineCount

But for large documents, the actual thumbHeight is bigger than it would be if
it were strictly proportional. We need to take this additional height into
account by subtracting the additional thumb height from the ruler area height.
That's because the additional thumb height effectively steals pixels from the
available thumb track height.

If we take the pixels away on the top and the bottom of the overview ruler, we
maintain the following property in all cases:
"For an annotation on the center line of the current viewport, the mark in the
overview ruler is on the same y-coordinate as the center of the thumb."

I've tried this and it works well, but on platforms where the additional thumb
height is more than a few pixels (on Cocoa, it's up to 26px) the 13px we'd be
giving away are quite noticeable when the thumb is at the very end or
beginning. I currently don't have a good idea how to solve that. Maybe we just
have to accept it, because every other strategy would for certain lines violate
the property given above.
Comment 1 Markus Keller CLA 2011-01-13 12:18:16 EST
Solved by the patch in bug 163769 comment 34.

*** This bug has been marked as a duplicate of bug 163769 ***