Bug: Plot window switching did not change the plot content.

Enable plotting the current graph to svg or ps by selecting
the graph from the current plot window.
This commit is contained in:
Holger Vogt 2021-06-10 16:44:55 +02:00
parent 604c4624d1
commit 1176bdb0b0
1 changed files with 6 additions and 2 deletions

View File

@ -281,12 +281,14 @@ static int LType(int ColorIndex)
/* called by SystemMenue / Postscript hardcopy */ /* called by SystemMenue / Postscript hardcopy */
static LRESULT HcpyPlotPS(HWND hwnd) static LRESULT HcpyPlotPS(HWND hwnd)
{ {
NG_IGNORE(hwnd);
int i = 1; int i = 1;
GRAPH* tmpgr = currentgraph;
currentgraph = pGraph(hwnd);
cp_vset("hcopydevtype", CP_STRING, "postscript"); cp_vset("hcopydevtype", CP_STRING, "postscript");
/* If not set, the color will be b&w, i = 1 is white background */ /* If not set, the color will be b&w, i = 1 is white background */
cp_vset("hcopypscolor", CP_NUM, &i); cp_vset("hcopypscolor", CP_NUM, &i);
com_hardcopy(NULL); com_hardcopy(NULL);
currentgraph = tmpgr;
/* update the text in the main window */ /* update the text in the main window */
UpdateMainText(); UpdateMainText();
SetFocus(swString); SetFocus(swString);
@ -297,9 +299,11 @@ static LRESULT HcpyPlotPS(HWND hwnd)
/* called by SystemMenue / SVG hardcopy */ /* called by SystemMenue / SVG hardcopy */
static LRESULT HcpyPlotSVG(HWND hwnd) static LRESULT HcpyPlotSVG(HWND hwnd)
{ {
NG_IGNORE(hwnd); GRAPH* tmpgr = currentgraph;
currentgraph = pGraph(hwnd);
cp_vset("hcopydevtype", CP_STRING, "svg"); cp_vset("hcopydevtype", CP_STRING, "svg");
com_hardcopy(NULL); com_hardcopy(NULL);
currentgraph = tmpgr;
/* update the text in the main window */ /* update the text in the main window */
UpdateMainText(); UpdateMainText();
SetFocus(swString); SetFocus(swString);