Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gnuplot: bugfix in splot, lw in aquaterm/qt/wxt
* Upstream patch to fix a bug in splot. Closes: https://trac.macports.org/ticket/53509 See: https://sourceforge.net/p/gnuplot/bugs/1904/ * Upstream patch to support setting linewidth in aquaterm/qt/wxt See: https://sourceforge.net/p/gnuplot/feature-requests/459/
- Loading branch information
Showing
3 changed files
with
175 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
# https://sourceforge.net/p/gnuplot/feature-requests/459/ | ||
--- src/qtterminal/qt_term.cpp.orig | ||
+++ src/qtterminal/qt_term.cpp | ||
@@ -164,6 +164,7 @@ static int qt_optionWidth = 640; | ||
static int qt_optionHeight = 480; | ||
static int qt_optionFontSize = 9; | ||
static double qt_optionDashLength = 1.0; | ||
+static double qt_optionLineWidth = 1.0; | ||
|
||
/* Encapsulates all Qt options that have a constructor and destructor. */ | ||
struct QtOption { | ||
@@ -797,7 +798,7 @@ void qt_pointsize(double ptsize) | ||
|
||
void qt_linewidth(double lw) | ||
{ | ||
- qt->out << GELineWidth << lw; | ||
+ qt->out << GELineWidth << lw * qt_optionLineWidth; | ||
} | ||
|
||
int qt_text_angle(int angle) | ||
@@ -1224,6 +1225,7 @@ enum QT_id { | ||
QT_DASH, | ||
QT_DASHLENGTH, | ||
QT_SOLID, | ||
+ QT_LINEWIDTH, | ||
QT_OTHER | ||
}; | ||
|
||
@@ -1246,6 +1248,8 @@ static struct gen_table qt_opts[] = { | ||
{"dashl$ength", QT_DASHLENGTH}, | ||
{"dl", QT_DASHLENGTH}, | ||
{"solid", QT_SOLID}, | ||
+ {"linew$idth", QT_LINEWIDTH}, | ||
+ {"lw", QT_LINEWIDTH}, | ||
{NULL, QT_OTHER} | ||
}; | ||
|
||
@@ -1268,6 +1272,7 @@ void qt_options() | ||
bool set_widget = false; | ||
bool set_dash = false; | ||
bool set_dashlength = false; | ||
+ bool set_linewidth = false; | ||
int previous_WindowId = qt_optionWindowId; | ||
|
||
#ifndef WIN32 | ||
@@ -1385,6 +1390,10 @@ void qt_options() | ||
// qt_optionDash = false; | ||
c_token++; | ||
break; | ||
+ case QT_LINEWIDTH: | ||
+ SETCHECKDUP(set_linewidth); | ||
+ qt_optionLineWidth = real_expression(); | ||
+ break; | ||
case QT_OTHER: | ||
default: | ||
qt_optionWindowId = int_expression(); | ||
@@ -1435,6 +1444,7 @@ void qt_options() | ||
|
||
if (set_enhanced) termOptions += qt_optionEnhanced ? " enhanced" : " noenhanced"; | ||
termOptions += " font \"" + fontSettings + '"'; | ||
+ if (set_linewidth) termOptions += " linewidth " + QString::number(qt_optionLineWidth); | ||
if (set_dashlength) termOptions += " dashlength " + QString::number(qt_optionDashLength); | ||
if (set_widget) termOptions += " widget \"" + qt_option->Widget + '"'; | ||
if (set_persist) termOptions += qt_optionPersist ? " persist" : " nopersist"; | ||
--- term/aquaterm.trm.orig | ||
+++ term/aquaterm.trm | ||
@@ -250,6 +250,16 @@ AQUA_options() | ||
continue; | ||
} | ||
|
||
+ if (equals(c_token, "lw") || almost_equals(c_token, "linew$idth")) { | ||
+ c_token++; | ||
+ if (END_OF_COMMAND) | ||
+ int_error(c_token, "expecting line width"); | ||
+ AQUA_LineWidth = real_expression(); | ||
+ if (AQUA_LineWidth < 0.0) | ||
+ AQUA_LineWidth = 1.0; | ||
+ continue; | ||
+ } | ||
+ | ||
if (equals(c_token, "dl") || almost_equals(c_token, "dashl$ength")) { | ||
c_token++; | ||
if (END_OF_COMMAND) | ||
@@ -295,6 +305,8 @@ AQUA_options() | ||
AQUA_dashedlines?"dashed":"solid"); | ||
if (AQUA_dashedlines) | ||
sprintf(&(term_options[strlen(term_options)]), " dl %3.1f", AQUA_dashlength_factor); | ||
+ if (AQUA_LineWidth != 1.0) | ||
+ sprintf(&(term_options[strlen(term_options)]), " linewidth %3.1f", AQUA_LineWidth); | ||
} | ||
|
||
static NSString* | ||
@@ -675,6 +687,7 @@ AQUA_boxfill(int style, unsigned int x1, unsigned int y1, unsigned int width, un | ||
TERM_PUBLIC void | ||
AQUA_linewidth(double linewidth) | ||
{ | ||
+ linewidth *= AQUA_LineWidth; | ||
[adapter setLinewidth:linewidth]; | ||
} | ||
|
||
@@ -960,7 +973,7 @@ TERM_TABLE_START(aqua_driver) | ||
AQUA_text_angle, | ||
AQUA_justify_text, AQUA_point, do_arrow, AQUA_set_font, | ||
AQUA_pointsize, | ||
- TERM_CAN_MULTIPLOT|TERM_NO_OUTPUTFILE|TERM_CAN_DASH|TERM_POLYGON_PIXELS, | ||
+ TERM_CAN_MULTIPLOT|TERM_NO_OUTPUTFILE|TERM_CAN_DASH|TERM_POLYGON_PIXELS|TERM_LINEWIDTH, | ||
AQUA_suspend, AQUA_resume, | ||
AQUA_boxfill, AQUA_linewidth | ||
#ifdef USE_MOUSE | ||
@@ -998,6 +1011,7 @@ START_HELP(aqua) | ||
" Syntax:", | ||
" set terminal aqua {<n>} {title \"<wintitle>\"} {size <x> <y>}", | ||
" {font \"<fontname>{,<fontsize>}\"}", | ||
+" {linewidth <lw>}\"}", | ||
" {{no}enhanced} {solid|dashed} {dl <dashlength>}}", | ||
"", | ||
" where <n> is the number of the window to draw in (default is 0),", | ||
--- term/qt.trm.orig | ||
+++ term/qt.trm | ||
@@ -53,7 +53,7 @@ TERM_TABLE_START (qt_driver) | ||
qt_text_angle, qt_justify_text, | ||
qt_point, do_arrow, qt_set_font, | ||
qt_pointsize, | ||
- TERM_CAN_MULTIPLOT|TERM_NO_OUTPUTFILE|TERM_ALPHA_CHANNEL|TERM_CAN_DASH|TERM_ENHANCED_TEXT|TERM_POLYGON_PIXELS, | ||
+ TERM_CAN_MULTIPLOT|TERM_NO_OUTPUTFILE|TERM_ALPHA_CHANNEL|TERM_CAN_DASH|TERM_ENHANCED_TEXT|TERM_POLYGON_PIXELS|TERM_LINEWIDTH, | ||
0 /* suspend */, 0 /* resume */, qt_fillbox, qt_linewidth | ||
#ifdef USE_MOUSE | ||
, qt_waitforinput, qt_put_tmptext, qt_set_ruler, qt_set_cursor, qt_set_clipboard | ||
@@ -94,7 +94,7 @@ START_HELP(qt) | ||
" {position <x>,<y>}", | ||
" {title \"title\"}", | ||
" {font <font>} {{no}enhanced}", | ||
-" {dashlength <dl>}", | ||
+" {linewidth <lw>} {dashlength <dl>}", | ||
" {{no}persist} {{no}raise} {{no}ctrl}", | ||
" {close}", | ||
" {widget <id>}", | ||
--- term/wxt.trm.orig | ||
+++ term/wxt.trm | ||
@@ -470,7 +470,7 @@ TERM_TABLE_START (wxt_driver) | ||
wxt_text_angle, wxt_justify_text, | ||
wxt_point, do_arrow, wxt_set_font, | ||
wxt_pointsize, | ||
- TERM_CAN_MULTIPLOT|TERM_NO_OUTPUTFILE|TERM_ALPHA_CHANNEL|TERM_CAN_DASH|TERM_FONTSCALE|TERM_ENHANCED_TEXT, | ||
+ TERM_CAN_MULTIPLOT|TERM_NO_OUTPUTFILE|TERM_ALPHA_CHANNEL|TERM_CAN_DASH|TERM_FONTSCALE|TERM_ENHANCED_TEXT|TERM_LINEWIDTH, | ||
wxt_text /* suspend */, 0 /* resume */, wxt_fillbox, wxt_linewidth | ||
#ifdef USE_MOUSE | ||
, wxt_waitforinput, wxt_put_tmptext, wxt_set_ruler, wxt_set_cursor, wxt_set_clipboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# https://trac.macports.org/ticket/53509 | ||
# https://sourceforge.net/p/gnuplot/bugs/1904/ | ||
--- src/hidden3d.c.orig | ||
+++ src/hidden3d.c | ||
@@ -1116,14 +1116,15 @@ build_networks(struct surface_points *plots, int pcount) | ||
nv += 2 * nverts; | ||
ne += nverts; | ||
break; | ||
- case DOTS: | ||
- this_plot->lp_properties.flags |= LP_SHOW_POINTS; | ||
- this_plot->lp_properties.p_type = -1; | ||
case IMAGE: | ||
case RGBIMAGE: | ||
case RGBA_IMAGE: | ||
/* Ignore these */ | ||
break; | ||
+ case DOTS: | ||
+ this_plot->lp_properties.flags |= LP_SHOW_POINTS; | ||
+ this_plot->lp_properties.p_type = -1; | ||
+ /* fall through */ | ||
case POINTSTYLE: | ||
default: | ||
/* treat all remaining ones like 'points' */ |