Fixing vertex implementation

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11032 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2016-01-23 00:39:33 +00:00
parent 28b94ce5e7
commit d1d136fa1b
7 changed files with 25 additions and 21 deletions

View File

@ -368,7 +368,7 @@ protected:
friend void fl_begin_polygon();
virtual void begin_polygon();
friend void fl_begin_complex_polygon();
virtual void begin_complex_polygon();
virtual void begin_complex_polygon() = 0;
friend double fl_transform_x(double x, double y);
virtual double transform_x(double x, double y);
friend double fl_transform_y(double x, double y);
@ -378,23 +378,23 @@ protected:
friend double fl_transform_dy(double x, double y);
virtual double transform_dy(double x, double y);
friend void fl_transformed_vertex(double xf, double yf);
virtual void transformed_vertex(double xf, double yf);
virtual void transformed_vertex(double xf, double yf) = 0;
friend void fl_vertex(double x, double y);
virtual void vertex(double x, double y);
virtual void vertex(double x, double y) = 0;
friend void fl_end_points();
virtual void end_points();
virtual void end_points() = 0;
friend void fl_end_line();
virtual void end_line();
virtual void end_line() = 0;
friend void fl_end_loop();
virtual void end_loop();
virtual void end_loop() = 0;
friend void fl_end_polygon();
virtual void end_polygon();
virtual void end_polygon() = 0;
friend void fl_end_complex_polygon();
virtual void end_complex_polygon();
virtual void end_complex_polygon() = 0;
friend void fl_gap();
virtual void gap();
virtual void gap() = 0;
friend void fl_circle(double x, double y, double r);
virtual void circle(double x, double y, double r);
virtual void circle(double x, double y, double r) = 0;
};

View File

@ -52,10 +52,6 @@ void Fl_GDI_Graphics_Driver::end_line() {
if (n>1) Polyline(fl_gc, p, n);
}
void Fl_GDI_Graphics_Driver::fixloop() { // remove equal points from closed path
while (n>2 && p[n-1].x == p[0].x && p[n-1].y == p[0].y) n--;
}
void Fl_GDI_Graphics_Driver::end_loop() {
fixloop();
if (n>2) transformed_vertex((COORD_T)p[0].x, (COORD_T)p[0].y);
@ -124,7 +120,7 @@ void Fl_GDI_Graphics_Driver::circle(double x, double y,double r) {
Arc(fl_gc, llx, lly, llx+w, lly+h, 0,0, 0,0);
}
#endif FL_CFG_GFX_GDI_VERTEX_CXX
#endif // FL_CFG_GFX_GDI_VERTEX_CXX
//
// End of "$Id$".

View File

@ -86,6 +86,16 @@ public:
// void end_complex_polygon();
// void gap();
// void circle(double x, double y, double r);
void begin_complex_polygon() { }
void transformed_vertex(double xf, double yf) { }
void vertex(double x, double y) { }
void end_points() { }
void end_line() { }
void end_loop() { }
void end_polygon() { }
void end_complex_polygon() { }
void gap() { }
void circle(double x, double y, double r) { }
};

View File

@ -94,7 +94,6 @@ protected:
void pop_clip();
void restore_clip();
// --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
void fixloop();
void begin_complex_polygon();
void transformed_vertex(double xf, double yf);
void vertex(double x, double y);

View File

@ -64,10 +64,6 @@ void Fl_Quartz_Graphics_Driver::end_line() {
CGContextSetShouldAntialias(fl_gc, false);
}
void Fl_Quartz_Graphics_Driver::fixloop() { // remove equal points from closed path
while (n>2 && p[n-1].x == p[0].x && p[n-1].y == p[0].y) n--;
}
void Fl_Quartz_Graphics_Driver::end_loop() {
fixloop();
if (n>2) transformed_vertex((COORD_T)p[0].x, (COORD_T)p[0].y);

View File

@ -83,7 +83,6 @@ protected:
void pop_clip();
void restore_clip();
// --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
void fixloop();
void begin_complex_polygon();
void transformed_vertex(double xf, double yf);
void vertex(double x, double y);

View File

@ -107,6 +107,10 @@ void Fl_Graphics_Driver::transformed_vertex0(COORD_T x, COORD_T y) {
}
}
void Fl_Graphics_Driver::fixloop() { // remove equal points from closed path
while (n>2 && p[n-1].x == p[0].x && p[n-1].y == p[0].y) n--;
}
// -----------------------------------------------------------------------------