FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Pointscale option for the windows terminal · gnuplot/gnuplot-old@7b178ed · GitHub

Repository navigation

Commit 7b178ed

Browse files
markisch
committed
Pointscale option for the windows terminal
1 parent f0fe7ef commit 7b178ed

6 files changed

Lines changed: 44 additions & 18 deletions

File tree

‎ChangeLog‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2017-05-21 Bastian Maerkisch <bmaerkisch@web.de>
2+
3+
* term/win.trm src/win/wgraph.c src/win/wgdiplus.cpp
4+
src/win/wd2d.cpp src/win/wgnuplib.h:
5+
Pointscale option for the windows terminal.
6+
17
2017-05-20 Bastian Maerkisch <bmaerkisch@web.de>
28

39
* src/win/winmain.c (ConsoleHandler) src/plot.c|h (terminate_flag)

‎src/win/wd2d.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: wd2d.cpp,v 1.5 2017-05-13 11:49:29 markisch Exp $
2+
* $Id: wd2d.cpp,v 1.6 2017-05-21 08:43:44 markisch Exp $
33
*/
44

55
/*
@@ -1452,8 +1452,8 @@ drawgraph_d2d(LPGW lpgw, HWND hwnd, LPRECT rect)
14521452
case W_pointsize:
14531453
if (curptr->x > 0) {
14541454
double pointsize = curptr->x / 100.0;
1455-
htic = pointsize * MulDiv(lpgw->htic, rr - rl, lpgw->xmax) + 1;
1456-
vtic = pointsize * MulDiv(lpgw->vtic, rb - rt, lpgw->ymax) + 1;
1455+
htic = MulDiv(pointsize * lpgw->pointscale * lpgw->htic, rr - rl, lpgw->xmax) + 1;
1456+
vtic = MulDiv(pointsize * lpgw->pointscale * lpgw->vtic, rb - rt, lpgw->ymax) + 1;
14571457
} else {
14581458
htic = vtic = 0;
14591459
}

‎src/win/wgdiplus.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: wgdiplus.cpp,v 1.58 2017-05-13 11:49:29 markisch Exp $
2+
* $Id: wgdiplus.cpp,v 1.59 2017-05-21 08:43:44 markisch Exp $
33
*/
44

55
/*
@@ -1275,8 +1275,8 @@ do_draw_gdiplus(LPGW lpgw, Graphics &graphics, LPRECT rect, enum draw_target tar
12751275
case W_pointsize:
12761276
if (curptr->x > 0) {
12771277
double pointsize = curptr->x / 100.0;
1278-
htic = MulDiv(pointsize * lpgw->htic, rr - rl, lpgw->xmax) + 1;
1279-
vtic = MulDiv(pointsize * lpgw->vtic, rb - rt, lpgw->ymax) + 1;
1278+
htic = MulDiv(pointsize * lpgw->pointscale * lpgw->htic, rr - rl, lpgw->xmax) + 1;
1279+
vtic = MulDiv(pointsize * lpgw->pointscale * lpgw->vtic, rb - rt, lpgw->ymax) + 1;
12801280
} else {
12811281
htic = vtic = 0;
12821282
}

‎src/win/wgnuplib.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: wgnuplib.h,v 1.88 2017-05-13 11:49:29 markisch Exp $
2+
* $Id: wgnuplib.h,v 1.89 2017-05-21 08:43:44 markisch Exp $
33
*/
44

55
/* GNUPLOT - win/wgnuplib.h */
@@ -382,6 +382,7 @@ typedef struct tagGW {
382382
double org_pointsize; /* Original Pointsize */
383383
int encoding_error; /* last unknown encoding */
384384
double fontscale; /* scale factor for font sizes */
385+
double pointscale; /* scale factor for point sizes */
385386
enum set_encoding_id encoding; /* text encoding */
386387
LONG tmHeight; /* text metric of current font */
387388
LONG tmAscent;

‎src/win/wgraph.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: wgraph.c,v 1.254 2017-05-15 14:58:46 markisch Exp $
2+
* $Id: wgraph.c,v 1.255 2017-05-21 08:43:44 markisch Exp $
33
*/
44

55
/* GNUPLOT - win/wgraph.c */
@@ -385,6 +385,7 @@ GraphInitStruct(LPGW lpgw)
385385
lpgw->sampling = 1;
386386
lpgw->fontscale = 1.;
387387
lpgw->linewidth = 1.;
388+
lpgw->pointscale = 1.;
388389
lpgw->color = TRUE;
389390
lpgw->dashed = FALSE;
390391
lpgw->IniSection = TEXT("WGNUPLOT");
@@ -2557,8 +2558,8 @@ drawgraph(LPGW lpgw, HDC hdc, LPRECT rect)
25572558
case W_pointsize:
25582559
if (curptr->x > 0) {
25592560
double pointsize = curptr->x / 100.0;
2560-
htic = MulDiv(pointsize * lpgw->htic, rr - rl, lpgw->xmax) + 1;
2561-
vtic = MulDiv(pointsize * lpgw->vtic, rb - rt, lpgw->ymax) + 1;
2561+
htic = MulDiv(pointsize * lpgw->pointscale * lpgw->htic, rr - rl, lpgw->xmax) + 1;
2562+
vtic = MulDiv(pointsize * lpgw->pointscale * lpgw->vtic, rb - rt, lpgw->ymax) + 1;
25622563
} else {
25632564
htic = vtic = 0;
25642565
}

‎term/win.trm‎

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Hello, Emacs, this is -*-C-*-
2-
* $Id: win.trm,v 1.142 2017-05-14 14:40:24 markisch Exp $
2+
* $Id: win.trm,v 1.143 2017-05-21 08:43:44 markisch Exp $
33
*/
44

55
/* GNUPLOT - win.trm */
@@ -128,8 +128,9 @@ TERM_PUBLIC void WIN_modify_plots __PROTO((unsigned int operations, int plotno))
128128

129129
enum WIN_id { WIN_DEFAULT, WIN_MONOCHROME, WIN_COLOR, WIN_GTITLE,
130130
WIN_ENHANCED, WIN_NOENHANCED, WIN_FONT, WIN_SIZE, WIN_WSIZE,
131-
WIN_POSITION, WIN_CLOSE, WIN_BACKGROUND, WIN_FONTSCALE,
132-
WIN_LINEWIDTH, WIN_SOLID, WIN_DASHED, WIN_ROUND, WIN_BUTT,
131+
WIN_POSITION, WIN_CLOSE, WIN_BACKGROUND,
132+
WIN_FONTSCALE, WIN_LINEWIDTH, WIN_POINTSCALE,
133+
WIN_SOLID, WIN_DASHED, WIN_ROUND, WIN_BUTT,
133134
WIN_DOCKED, WIN_STANDALONE, WIN_LAYOUT,
134135
WIN_OTHER };
135136

@@ -150,6 +151,8 @@ static struct gen_table WIN_opts[] =
150151
{ "fonts$cale", WIN_FONTSCALE },
151152
{ "linewidth", WIN_LINEWIDTH },
152153
{ "lw", WIN_LINEWIDTH },
154+
{ "pointscale", WIN_POINTSCALE},
155+
{ "ps", WIN_POINTSCALE},
153156
{ "ti$tle", WIN_GTITLE },
154157
{ "siz$e", WIN_SIZE },
155158
{ "ws$ize", WIN_WSIZE },
@@ -223,9 +226,11 @@ WIN_options()
223226
TBOOLEAN set_position = FALSE, set_number = FALSE;
224227
TBOOLEAN set_wsize = FALSE, set_rounded = FALSE;
225228
TBOOLEAN set_docked = FALSE, set_layout = FALSE;
229+
TBOOLEAN set_pointscale = FALSE;
226230
TBOOLEAN color, dashed, rounded;
227231
COLORREF background;
228232
double fontscale, linewidth;
233+
double pointscale;
229234
int win_x = 0;
230235
int win_y = 0;
231236
int win_width = 0;
@@ -248,10 +253,10 @@ WIN_options()
248253
strcpy(fontname, WIN_inifontname);
249254
#endif
250255
fontsize = WIN_inifontsize;
251-
fontscale = linewidth = 1;
256+
fontscale = linewidth = pointscale = 1;
252257
set_color = set_dashed = TRUE;
253258
set_font = set_fontsize = TRUE;
254-
set_fontscale = set_linewidth = TRUE;
259+
set_fontscale = set_linewidth = set_pointscale = TRUE;
255260
set_rounded = TRUE;
256261
c_token++;
257262
break;
@@ -299,6 +304,12 @@ WIN_options()
299304
set_linewidth = TRUE;
300305
break;
301306
}
307+
case WIN_POINTSCALE:
308+
c_token++;
309+
pointscale = real_expression();
310+
if (pointscale <= 0.0) pointscale = 1.;
311+
set_pointscale = TRUE;
312+
break;
302313
case WIN_SOLID:
303314
c_token++;
304315
dashed = FALSE;
@@ -486,6 +497,8 @@ WIN_options()
486497
graphwin->fontscale = fontscale;
487498
if (set_linewidth)
488499
graphwin->linewidth = linewidth;
500+
if (set_pointscale)
501+
graphwin->pointscale = pointscale;
489502
if (set_size || set_wsize) {
490503
graphwin->Size.x = win_width;
491504
graphwin->Size.y = win_height;
@@ -618,6 +631,10 @@ WIN_update_options()
618631
sprintf(&(term_options[strlen(term_options)]),
619632
" linewidth %.1f", graphwin->linewidth);
620633

634+
if (graphwin->pointscale != 1)
635+
sprintf(&(term_options[strlen(term_options)]),
636+
" pointscale %.1f", graphwin->pointscale);
637+
621638
if (!graphwin->bDocked) {
622639
if (graphwin->Canvas.x != 0)
623640
sprintf(&(term_options[strlen(term_options)]),
@@ -1130,7 +1147,7 @@ TERM_TABLE_START(win_driver)
11301147
WIN_justify_text, WIN_point, do_arrow, WIN_set_font,
11311148
WIN_set_pointsize,
11321149
TERM_CAN_MULTIPLOT|TERM_NO_OUTPUTFILE|TERM_ALPHA_CHANNEL|TERM_CAN_DASH
1133-
|TERM_LINEWIDTH|TERM_FONTSCALE|TERM_ENHANCED_TEXT,
1150+
|TERM_LINEWIDTH|TERM_FONTSCALE|TERM_POINTSCALE|TERM_ENHANCED_TEXT,
11341151
WIN_text /* suspend */ , WIN_resume,
11351152
WIN_boxfill, WIN_linewidth,
11361153
#ifdef USE_MOUSE
@@ -1183,6 +1200,7 @@ START_HELP(windows)
11831200
" {font <fontspec>}",
11841201
" {fontscale <scale>}",
11851202
" {linewdith <scale>}",
1203+
" {pointscale <scale>}",
11861204
" {background <rgb color>}",
11871205
" {title \"Plot Window Title\"}",
11881206
" {{size | wsize} <width>,<height>}",
@@ -1206,8 +1224,8 @@ START_HELP(windows)
12061224
" Note that in previous versions of gnuplot the `font` statement could be left",
12071225
" out and <fontsize> could be given as a number without double quotes. This is",
12081226
" no longer supported.",
1209-
" `linewidth` and `fontscale` can be used to scale the width of lines and",
1210-
" the size of text.",
1227+
" `linewidth`, `fontscale`, `pointscale` can be used to scale the width of",
1228+
" lines, the size of text, or the size of the point symbols.",
12111229
" `title` changes the title of the graph window.",
12121230
" `size` defines the width and height of the window's drawing area in pixels,",
12131231
" `wsize` defines the actual size of the window itself and `position` defines",

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL