From ff01188004ab584bec490e39397b9345cc19306b Mon Sep 17 00:00:00 2001 From: user <user@user-ThinkPad-X60.(none)> Date: Fri, 15 May 2015 02:15:42 -0400 Subject: [PATCH] first shot at getting scalars to work with the ridiculous canvas scaling "feature" --- pd/src/g_scalar.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pd/src/g_scalar.c b/pd/src/g_scalar.c index 2464db7b4..9352813d0 100644 --- a/pd/src/g_scalar.c +++ b/pd/src/g_scalar.c @@ -461,7 +461,7 @@ void scalar_drawselectrect(t_scalar *x, t_glist *glist, int state) glist_xtopixels(glist, 0); t_float yscale = glist_ytopixels(glist, 1) - glist_ytopixels(glist, 0); - +post("xsclae is %g and yscale is %g", xscale, yscale); //sys_vgui(".x%lx.c create prect %d %d %d %d " // "-strokewidth 1 -stroke $pd_colors(selection) " // "-tags {select%lx selected}\n", @@ -470,7 +470,12 @@ void scalar_drawselectrect(t_scalar *x, t_glist *glist, int state) gui_vmess("gui_scalar_draw_select_rect", "xsiiiiiff", glist_getcanvas(glist), tagbuf, state, - x1, y1, x2, y2, basex, basey); + (int)(x1 / xscale + 0.499), + (int)(y1 / yscale + 0.499), + (int)(x2 / xscale + 0.499), + (int)(y2 / yscale + 0.499), + basex, + basey); } } else -- GitLab