Skip to content

Commit 7216b60

Browse files
committed
pm: make use of constants instead of hard-coded values
1 parent 2660655 commit 7216b60

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/os2/gclient.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ EXPENTRY DisplayClientWndProc(HWND hWnd, ULONG message, MPARAM mp1, MPARAM mp2)
661661
NumColors, PalSupport & CAPS_PALETTE_MANAGER, !bPMPaletteMode ));
662662

663663
sizlPage.cx = 0; sizlPage.cy = 0;
664-
sizlPage.cx = 19500; sizlPage.cy = 12500;
664+
sizlPage.cx = GNUXPAGE; sizlPage.cy = GNUYPAGE;
665665
hpsScreen = GpiCreatePS(hab, hdcScreen, &sizlPage,
666666
PU_HIMETRIC|GPIT_NORMAL|GPIA_ASSOC);
667667
/* spawn server for GNUPLOT ... */
@@ -2135,9 +2135,9 @@ ReadGnu(void* arg)
21352135
GpiSetColor(hps, color = RGB_TRANS(CLR_RED)); /* cross the unfinished plot */
21362136
GpiBeginPath(hps, 1);
21372137
p.x = p.y = 0; GpiMove(hps, &p);
2138-
p.x = 19500; p.y = 12500; GpiLine(hps, &p);
2139-
p.x = 0; p.y = 12500; GpiMove(hps, &p);
2140-
p.x = 19500; p.y = 0; GpiLine(hps, &p);
2138+
p.x = GNUXPAGE; p.y = GNUYPAGE; GpiLine(hps, &p);
2139+
p.x = 0; p.y = GNUYPAGE; GpiMove(hps, &p);
2140+
p.x = GNUXPAGE; p.y = 0; GpiLine(hps, &p);
21412141
GpiEndPath(hps);
21422142
GpiStrokePath(hps, 1, 0);
21432143
}
@@ -3074,8 +3074,8 @@ ReadGnu(void* arg)
30743074
rc.xRight -= rc.xLeft;
30753075
rc.yTop -= rc.yBottom;
30763076
/* window => pixels coordinates */
3077-
pt.x =(long int) ((x * (double) rc.xRight) / 19500.0);
3078-
pt.y =(long int) ((x * (double) rc.yTop) / 12500.0);
3077+
pt.x =(long int) ((x * (double) rc.xRight) / (double) GNUXPAGE);
3078+
pt.y =(long int) ((x * (double) rc.yTop) / (double) GNUYPAGE);
30793079
WinMapWindowPoints(hApp, HWND_DESKTOP, &pt, 1);
30803080
WinSetPointerPos(HWND_DESKTOP, pt.x, pt.y);
30813081
break;
@@ -3842,14 +3842,14 @@ DrawRuler()
38423842
p.y = ruler.y;
38433843
GpiMove(hpsScreen, &p);
38443844

3845-
p.x = 19500;
3845+
p.x = GNUXPAGE;
38463846
GpiLine(hpsScreen, &p);
38473847

38483848
p.x = ruler.x;
38493849
p.y = 0;
38503850
GpiMove(hpsScreen, &p);
38513851

3852-
p.y = 12500;
3852+
p.y = GNUYPAGE;
38533853
GpiLine(hpsScreen, &p);
38543854
}
38553855

@@ -3869,10 +3869,10 @@ MousePosToViewport(int *x, int *y, SHORT mx, SHORT my)
38693869
rc.yTop -= rc.yBottom; /* only distance is important */
38703870

38713871
/* px=px(mx); mouse=>gnuplot driver coordinates */
3872-
*x = (int)(mx * 19500.0 / rc.xRight + 0.5);
3873-
*y = (int)(my * 12500.0 / rc.yTop + 0.5);
3872+
*x = (int)(mx * (double) GNUXPAGE / rc.xRight + 0.5);
3873+
*y = (int)(my * (double) GNUYPAGE / rc.yTop + 0.5);
38743874
} else {
3875-
/* call was unsuccessfull */
3875+
/* call was unsuccessful */
38763876
*x = *y = 0;
38773877
}
38783878
}

0 commit comments

Comments
 (0)