mirror of https://github.com/fltk/fltk
Fix "line_style_doc program under X11: join type wrong" (#1017)
This commit is contained in:
parent
dc95cd55c0
commit
5e6c47f446
|
@ -1078,10 +1078,7 @@ void Fl_Scalable_Graphics_Driver::rectf_unscaled(int x, int y, int w, int h) {}
|
|||
|
||||
void Fl_Scalable_Graphics_Driver::line_unscaled(int x, int y, int x1, int y1) {}
|
||||
|
||||
void Fl_Scalable_Graphics_Driver::line_unscaled(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
line_unscaled(x, y, x1, y1);
|
||||
line_unscaled(x1, y1, x2, y2);
|
||||
}
|
||||
void Fl_Scalable_Graphics_Driver::line_unscaled(int x, int y, int x1, int y1, int x2, int y2) {}
|
||||
|
||||
void Fl_Scalable_Graphics_Driver::xyline_unscaled(int x, int y, int x1) {}
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ protected:
|
|||
void rectf_unscaled(int x, int y, int w, int h) FL_OVERRIDE;
|
||||
void colored_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) FL_OVERRIDE;
|
||||
void line_unscaled(int x, int y, int x1, int y1) FL_OVERRIDE;
|
||||
void line_unscaled(int x, int y, int x1, int y1, int x2, int y2) FL_OVERRIDE;
|
||||
void xyline_unscaled(int x, int y, int x1) FL_OVERRIDE;
|
||||
void *change_pen_width(int lwidth) FL_OVERRIDE;
|
||||
void reset_pen_width(void *data) FL_OVERRIDE;
|
||||
|
|
|
@ -239,6 +239,17 @@ void Fl_Xlib_Graphics_Driver::line_unscaled(int x, int y, int x1, int y1) {
|
|||
x1 + this->floor(offset_x_) , y1 + this->floor(offset_y_) );
|
||||
}
|
||||
|
||||
void Fl_Xlib_Graphics_Driver::line_unscaled(int x, int y, int x1, int y1, int x2, int y2) {
|
||||
if (!clip_line(x1, y1, x, y) && !clip_line(x1, y1, x2, y2)) {
|
||||
XPoint p[3];
|
||||
int offset = floor(offset_x_);
|
||||
p[0].x = x + offset; p[0].y = y + offset;
|
||||
p[1].x = x1 + offset; p[1].y = y1 + offset;
|
||||
p[2].x = x2 + offset; p[2].y = y2 + offset;
|
||||
XDrawLines(fl_display, fl_window, gc_, p, 3, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Fl_Xlib_Graphics_Driver::xyline_unscaled(int x, int y, int x1) {
|
||||
if (line_width_ >= 2) x1++;
|
||||
x += floor(offset_x_) ;
|
||||
|
|
Loading…
Reference in New Issue