rulers: fix subtle off-by-one pixel error caused by double-rounding
This change also makes it more clear that we're computing window-coordinate system values for the x-axis than the previous inaccurate version was
This commit is contained in:
parent
aaff07f2c9
commit
0a597bea66
@ -167,7 +167,7 @@ Ruler::render (Rect const & area, Cairo::RefPtr<Cairo::Context> cr) const
|
|||||||
Duple pos;
|
Duple pos;
|
||||||
Pango::FontDescription* fd = (m->style == Mark::Major) ? (_second_font_description ? _second_font_description : _font_description) : _font_description;
|
Pango::FontDescription* fd = (m->style == Mark::Major) ? (_second_font_description ? _second_font_description : _font_description) : _font_description;
|
||||||
|
|
||||||
pos.x = round ((m->position - _lower) / _metric->units_per_pixel);
|
pos.x = round (m->position/_metric->units_per_pixel) + self.x0;
|
||||||
pos.y = self.y1; /* bottom edge */
|
pos.y = self.y1; /* bottom edge */
|
||||||
|
|
||||||
if (fd != last_font_description) {
|
if (fd != last_font_description) {
|
||||||
|
Loading…
Reference in New Issue
Block a user