summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>1999-03-04 18:32:14 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>1999-03-04 18:32:14 +0000
commite9dd6127e2199b49b3d9800b69f7175ae496593c (patch)
treeb0306acb457978be6fd1b4615bd33144950fc068
parente3eaeb0f5ca141476767f265dafbef1744d5af62 (diff)
WIN32 fixes from Dmitry Potapov:
- Added WM_SYNCPAINT message support to get rid of redraw bugs. - Changed extra LineTo's to SetPixel's and associated fixes so that lines are drawn consistently between X and WIN32. git-svn-id: file:///fltk/svn/fltk/trunk@363 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_win32.cxx18
-rw-r--r--src/fl_rect.cxx15
2 files changed, 27 insertions, 6 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 5bc268324..774e72e24 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_win32.cxx,v 1.30 1999/03/03 07:40:18 bill Exp $"
+// "$Id: Fl_win32.cxx,v 1.31 1999/03/04 18:32:13 mike Exp $"
//
// WIN32-specific code for the Fast Light Tool Kit (FLTK).
//
@@ -329,6 +329,20 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
{
static char buffer[2];
+ static int cnt=0;
+ if(uMsg == WM_SYNCPAINT)
+ {
+ if(cnt)
+ {
+ InvalidateRect(fl_window,0,FALSE);
+ cnt = 0;
+ } else {
+ cnt = 1;
+ }
+ } else if (uMsg == WM_PAINT) {
+ cnt = 0;
+ }
+
fl_msg.message = uMsg;
Fl_Window *window = fl_find(hWnd);
@@ -891,5 +905,5 @@ void Fl_Window::make_current() {
}
//
-// End of "$Id: Fl_win32.cxx,v 1.30 1999/03/03 07:40:18 bill Exp $".
+// End of "$Id: Fl_win32.cxx,v 1.31 1999/03/04 18:32:13 mike Exp $".
//
diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx
index 03fa68967..0deea6bc4 100644
--- a/src/fl_rect.cxx
+++ b/src/fl_rect.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_rect.cxx,v 1.9 1999/02/01 01:59:13 mike Exp $"
+// "$Id: fl_rect.cxx,v 1.10 1999/03/04 18:32:14 mike Exp $"
//
// Rectangle drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -68,6 +68,7 @@ void fl_xyline(int x, int y, int x1) {
void fl_xyline(int x, int y, int x1, int y2) {
#ifdef WIN32
if (y2 < y) y2--;
+ else y2++;
MoveToEx(fl_gc, x, y, 0L);
LineTo(fl_gc, x1, y);
LineTo(fl_gc, x1, y2);
@@ -81,6 +82,8 @@ void fl_xyline(int x, int y, int x1, int y2) {
void fl_xyline(int x, int y, int x1, int y2, int x3) {
#ifdef WIN32
+ if(x3 < x1) x3--;
+ else x3++;
MoveToEx(fl_gc, x, y, 0L);
LineTo(fl_gc, x1, y);
LineTo(fl_gc, x1, y2);
@@ -97,6 +100,7 @@ void fl_xyline(int x, int y, int x1, int y2, int x3) {
void fl_yxline(int x, int y, int y1) {
#ifdef WIN32
if (y1 < y) y1--;
+ else y1++;
MoveToEx(fl_gc, x, y, 0L); LineTo(fl_gc, x, y1);
#else
XDrawLine(fl_display, fl_window, fl_gc, x, y, x, y1);
@@ -106,6 +110,7 @@ void fl_yxline(int x, int y, int y1) {
void fl_yxline(int x, int y, int y1, int x2) {
#ifdef WIN32
if (x2 > x) x2++;
+ else x2--;
MoveToEx(fl_gc, x, y, 0L);
LineTo(fl_gc, x, y1);
LineTo(fl_gc, x2, y1);
@@ -119,6 +124,8 @@ void fl_yxline(int x, int y, int y1, int x2) {
void fl_yxline(int x, int y, int y1, int x2, int y3) {
#ifdef WIN32
+ if(y3<y1) y3--;
+ else y3++;
MoveToEx(fl_gc, x, y, 0L);
LineTo(fl_gc, x, y1);
LineTo(fl_gc, x2, y1);
@@ -138,7 +145,7 @@ void fl_line(int x, int y, int x1, int y1) {
LineTo(fl_gc, x1, y1);
// Draw the last point *again* because the GDI line drawing
// functions will not draw the last point ("it's a feature!"...)
- LineTo(fl_gc, x1, y1);
+ SetPixel(fl_gc, x1, y1, fl_RGB());
#else
XDrawLine(fl_display, fl_window, fl_gc, x, y, x1, y1);
#endif
@@ -151,7 +158,7 @@ void fl_line(int x, int y, int x1, int y1, int x2, int y2) {
LineTo(fl_gc, x2, y2);
// Draw the last point *again* because the GDI line drawing
// functions will not draw the last point ("it's a feature!"...)
- LineTo(fl_gc, x2, y2);
+ SetPixel(fl_gc, x2, y2, fl_RGB());
#else
XPoint p[3];
p[0].x = x; p[0].y = y;
@@ -379,5 +386,5 @@ int fl_clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H){
}
//
-// End of "$Id: fl_rect.cxx,v 1.9 1999/02/01 01:59:13 mike Exp $".
+// End of "$Id: fl_rect.cxx,v 1.10 1999/03/04 18:32:14 mike Exp $".
//