cairo single pixel line offset fix, part 1
This commit is contained in:
parent
8c479ff425
commit
4c845eb2a0
@ -135,12 +135,12 @@ LineSet::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
|||||||
|
|
||||||
if (_orientation == Horizontal) {
|
if (_orientation == Horizontal) {
|
||||||
const double y = item_to_window (Duple (0, l.pos)).y;
|
const double y = item_to_window (Duple (0, l.pos)).y;
|
||||||
context->move_to (intersection.x0, y - shift);
|
context->move_to (intersection.x0, y + shift);
|
||||||
context->line_to (intersection.x1, y - shift);
|
context->line_to (intersection.x1, y + shift);
|
||||||
} else {
|
} else {
|
||||||
const double x = item_to_window (Duple (l.pos, 0)).x;
|
const double x = item_to_window (Duple (l.pos, 0)).x;
|
||||||
context->move_to (x - shift, intersection.y0);
|
context->move_to (x + shift, intersection.y0);
|
||||||
context->line_to (x - shift, intersection.y1);
|
context->line_to (x + shift, intersection.y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
context->stroke ();
|
context->stroke ();
|
||||||
|
@ -147,8 +147,8 @@ Ruler::render (Rect const & area, Cairo::RefPtr<Cairo::Context> cr) const
|
|||||||
|
|
||||||
if (_outline_width == 1.0) {
|
if (_outline_width == 1.0) {
|
||||||
/* Cairo single pixel line correction */
|
/* Cairo single pixel line correction */
|
||||||
cr->move_to (self.x0, self.y1-0.5);
|
cr->move_to (self.x0, self.y1+0.5);
|
||||||
cr->line_to (self.x1, self.y1-0.5);
|
cr->line_to (self.x1, self.y1+0.5);
|
||||||
} else {
|
} else {
|
||||||
cr->move_to (self.x0, self.y1);
|
cr->move_to (self.x0, self.y1);
|
||||||
cr->line_to (self.x1, self.y1);
|
cr->line_to (self.x1, self.y1);
|
||||||
|
Loading…
Reference in New Issue
Block a user