Commit e2e6612b authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

first step at fixing plot vis

parent 8b2e10f7
...@@ -5264,8 +5264,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, ...@@ -5264,8 +5264,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist,
{ {
t_float xscale = glist_xtopixels(glist, 1) - glist_xtopixels(glist, 0); t_float xscale = glist_xtopixels(glist, 1) - glist_xtopixels(glist, 0);
t_float yscale = glist_ytopixels(glist, 1) - glist_ytopixels(glist, 0); t_float yscale = glist_ytopixels(glist, 1) - glist_ytopixels(glist, 0);
t_float testy_y = 1 / yscale; t_float y_factor = 1 / yscale;
// post("testy_y is %g", testy_y);
symfill = (style == PLOTSTYLE_POINTS ? symoutline : symfill); symfill = (style == PLOTSTYLE_POINTS ? symoutline : symfill);
t_float minyval = 1e20, maxyval = -1e20; t_float minyval = 1e20, maxyval = -1e20;
...@@ -5310,7 +5309,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, ...@@ -5310,7 +5309,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist,
{ {
int py2 = 0; int py2 = 0;
//int border = 0; //int border = 0;
if(style == PLOTSTYLE_POINTS) if (style == PLOTSTYLE_POINTS)
py2 = (int)fielddesc_cvttocoord(yfielddesc, maxyval) py2 = (int)fielddesc_cvttocoord(yfielddesc, maxyval)
+ linewidth - 1; + linewidth - 1;
else else
...@@ -5325,7 +5324,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, ...@@ -5325,7 +5324,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist,
int x1, y1, x2, y2; int x1, y1, x2, y2;
graph_graphrect(&glist->gl_gobj, glist->gl_owner, graph_graphrect(&glist->gl_gobj, glist->gl_owner,
&x1, &y1, &x2, &y2); &x1, &y1, &x2, &y2);
py2 = y2; py2 = y2 - y1;
//border = 1; //border = 1;
} }
} }
...@@ -5369,7 +5368,8 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, ...@@ -5369,7 +5368,8 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist,
t_float mey1 = fielddesc_cvttocoord(yfielddesc, minyval) - 1; t_float mey1 = fielddesc_cvttocoord(yfielddesc, minyval) - 1;
int mex2 = inextx; int mex2 = inextx;
int mey2 = py2; t_float mey2 = style == PLOTSTYLE_POINTS ?
yval + y_factor * linewidth : py2 * y_factor;
//sys_vgui("M %d %d H %d V %d H %d z \\\n", //sys_vgui("M %d %d H %d V %d H %d z \\\n",
// mex1, mey1, mex2, mey2, mex1); // mex1, mey1, mex2, mey2, mex1);
...@@ -5382,8 +5382,8 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, ...@@ -5382,8 +5382,8 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist,
gui_i(mex2); gui_i(mex2);
gui_s("V"); gui_s("V");
gui_f(yval + testy_y * linewidth); // gui_f(yval + y_factor * linewidth);
// gui_i(mey2); gui_f(mey2);
gui_s("H"); gui_s("H");
gui_i(mex1); gui_i(mex1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment