aboutsummaryrefslogtreecommitdiff
path: root/pd/src/g_rtext.c
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2005-07-02 05:03:06 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2005-07-02 05:03:06 +0000
commit8c3faa20d73622d75573f1458218b36ee5613a7e (patch)
tree76987130124f0b57b25e2a0777dbd2e4d4fe00f8 /pd/src/g_rtext.c
parentc59464f01c8151baaa42dcb8641d73c58dc79fda (diff)
new graph-on-parent behavior - no more of the stretching behavior. Existing
patches should behave compatibly, but new ones will work differently (much much better.) svn path=/trunk/; revision=3283
Diffstat (limited to 'pd/src/g_rtext.c')
-rw-r--r--pd/src/g_rtext.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/pd/src/g_rtext.c b/pd/src/g_rtext.c
index 0de6903e..a07e20a9 100644
--- a/pd/src/g_rtext.c
+++ b/pd/src/g_rtext.c
@@ -153,17 +153,24 @@ static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp,
float dispx, dispy;
char smallbuf[200], *tempbuf;
int outchars = 0, nlines = 0, ncolumns = 0,
- pixwide, pixhigh;
- int font = glist_getfont(x->x_glist);
- int fontwidth = sys_fontwidth(font), fontheight = sys_fontheight(font);
- int findx = (*widthp + (fontwidth/2)) / fontwidth,
- findy = *heightp / fontheight;
+ pixwide, pixhigh, font, fontwidth, fontheight, findx, findy;
int reportedindex = 0;
t_canvas *canvas = glist_getcanvas(x->x_glist);
int widthspec = x->x_text->te_width;
int widthlimit = (widthspec ? widthspec : BOXWIDTH);
int inindex = 0;
int selstart = 0, selend = 0;
+ /* if we're a GOP (the new, "goprect" style) borrow the font size
+ from the inside to preserve the spacing */
+ if (pd_class(&x->x_text->te_pd) == canvas_class &&
+ ((t_glist *)(x->x_text))->gl_isgraph &&
+ ((t_glist *)(x->x_text))->gl_goprect)
+ font = glist_getfont((t_glist *)(x->x_text));
+ else font = glist_getfont(x->x_glist);
+ fontwidth = sys_fontwidth(font);
+ fontheight = sys_fontheight(font);
+ findx = (*widthp + (fontwidth/2)) / fontwidth;
+ findy = *heightp / fontheight;
if (x->x_bufsize >= 100)
tempbuf = (char *)t_getbytes(2 * x->x_bufsize + 1);
else tempbuf = smallbuf;