diff options
| author | Manolo Gouy <Manolo> | 2016-03-26 14:36:11 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-26 14:36:11 +0000 |
| commit | 915d6c643a8b4e31ea79fdad81761d26b42530f5 (patch) | |
| tree | 8756c72f988596beb8e55382f40ff04142816057 /src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx | |
| parent | e86e4a6ab0e3ad8ccbb694909383f5d72b9b4c92 (diff) | |
Isolate the definition of the 3 public, OS-dependent types (Fl_Offscreen, Fl_Region, Fl_Bitmask).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11432 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx')
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx index 1ff8755e8..0de553c87 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx @@ -33,11 +33,11 @@ void Fl_Quartz_Graphics_Driver::transformed_vertex(double xf, double yf) { - transformed_vertex0(COORD_T(xf), COORD_T(yf)); + transformed_vertex0(float(xf), float(yf)); } void Fl_Quartz_Graphics_Driver::vertex(double x,double y) { - transformed_vertex0(COORD_T(x*m.a + y*m.c + m.x), COORD_T(x*m.b + y*m.d + m.y)); + transformed_vertex0(float(x*m.a + y*m.c + m.x), float(x*m.b + y*m.d + m.y)); } void Fl_Quartz_Graphics_Driver::end_points() { @@ -66,7 +66,7 @@ void Fl_Quartz_Graphics_Driver::end_line() { void Fl_Quartz_Graphics_Driver::end_loop() { fixloop(); - if (n>2) transformed_vertex((COORD_T)p[0].x, (COORD_T)p[0].y); + if (n>2) transformed_vertex((float)p[0].x, (float)p[0].y); end_line(); } @@ -94,7 +94,7 @@ void Fl_Quartz_Graphics_Driver::begin_complex_polygon() { void Fl_Quartz_Graphics_Driver::gap() { while (n>gap_+2 && p[n-1].x == p[gap_].x && p[n-1].y == p[gap_].y) n--; if (n > gap_+2) { - transformed_vertex((COORD_T)p[gap_].x, (COORD_T)p[gap_].y); + transformed_vertex((float)p[gap_].x, (float)p[gap_].y); gap_ = n; } else { n = gap_; @@ -135,6 +135,23 @@ void Fl_Quartz_Graphics_Driver::circle(double x, double y,double r) { CGContextSetShouldAntialias(gc_, false); } +void Fl_Quartz_Graphics_Driver::transformed_vertex0(float x, float y) { + if (!n || x != p[n-1].x || y != p[n-1].y) { + if (n >= p_size) { + p_size = p ? 2*p_size : 16; + p = (XPOINT*)realloc((void*)p, p_size*sizeof(*p)); + } + p[n].x = x; + p[n].y = y; + n++; + } +} + +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--; +} + + #endif // FL_CFG_GFX_QUARTZ // |
