Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Aayush
purr-data
Commits
935a2e2d
Commit
935a2e2d
authored
May 08, 2015
by
user
Browse files
fixed gatom label position
parent
8c7119f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
pd/nw/pdgui.js
View file @
935a2e2d
...
...
@@ -2096,8 +2096,7 @@ function gui_canvas_updateline(cid,tag,x1,y1,x2,y2,yoff) {
configure_item
(
cord
,
{
d
:
d_array
.
join
(
"
"
)
});
}
function
gui_text_new
(
canvasname
,
myname
,
type
,
isselected
,
left_margin
,
top_margin
,
bottom_margin
,
pix_high
,
text
,
font
)
{
function
gui_text_new
(
canvasname
,
myname
,
type
,
isselected
,
x
,
y
,
text
,
font
)
{
// gui_post("font is " + font);
var
g
=
get_gobj
(
canvasname
,
myname
);
...
...
@@ -2106,8 +2105,8 @@ function gui_text_new(canvasname, myname, type, isselected, left_margin, top_mar
// at the top-right corner of the text's bbox. SVG uses the baseline.
// There's probably a programmatic way to do this, but for now-- fudge factors
// based on the DejaVu Sans Mono font. :)
x
:
left_margin
,
y
:
pix_high
-
bottom_margin
-
top_margin
-
1
,
x
:
x
,
y
:
y
,
// Turns out we can't do 'hanging' baseline
// because it's borked when scaled. Bummer...
// 'dominant-baseline': 'hanging',
...
...
pd/src/g_rtext.c
View file @
935a2e2d
...
...
@@ -362,13 +362,14 @@ static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp,
// dispx + LMARGIN, dispy + TMARGIN,
// outchars_b, tempbuf, sys_hostfontsize(font),
// (glist_isselected(x->x_glist, ((t_gobj*)x->x_text)) ? "$pd_colors(selection)" : "$pd_colors(text)"));
gui_vmess
(
"gui_text_new"
,
"sssiii
ii
si"
,
gui_vmess
(
"gui_text_new"
,
"sssiiisi"
,
canvas_tag
(
canvas
),
x
->
x_tag
,
rtext_gettype
(
x
)
->
s_name
,
glist_isselected
(
x
->
x_glist
,
((
t_gobj
*
)
x
->
x_text
)),
LMARGIN
,
TMARGIN
,
BMARGIN
,
pixhigh
,
pixhigh
-
BMARGIN
-
TMARGIN
-
1
,
// TMARGIN,
// BMARGIN,
// pixhigh,
// dispx + LMARGIN,
// dispy + TMARGIN,
tempbuf
,
...
...
pd/src/g_text.c
View file @
935a2e2d
...
...
@@ -1159,33 +1159,6 @@ static void gatom_param(t_gatom *x, t_symbol *sel, int argc, t_atom *argv)
}
/* ---------------- gatom-specific widget functions --------------- */
static
void
gatom_getwherelabel_delme
(
t_gatom
*
x
,
t_glist
*
glist
,
int
*
xp
,
int
*
yp
)
{
int
x1
,
y1
,
x2
,
y2
;
text_getrect
(
&
x
->
a_text
.
te_g
,
glist
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
if
(
x
->
a_wherelabel
==
ATOM_LABELLEFT
)
{
*
xp
=
x1
-
3
-
strlen
(
canvas_realizedollar
(
x
->
a_glist
,
x
->
a_label
)
->
s_name
)
*
sys_fontwidth
(
glist_getfont
(
glist
));
*
yp
=
y1
+
2
;
}
else
if
(
x
->
a_wherelabel
==
ATOM_LABELRIGHT
)
{
*
xp
=
x2
+
2
;
*
yp
=
y1
+
2
;
}
else
if
(
x
->
a_wherelabel
==
ATOM_LABELUP
)
{
*
xp
=
x1
-
1
;
*
yp
=
y1
-
1
-
sys_fontheight
(
glist_getfont
(
glist
));;
}
else
{
*
xp
=
x1
-
1
;
*
yp
=
y2
+
3
;
}
}
static
void
gatom_getwherelabel
(
t_gatom
*
x
,
t_glist
*
glist
,
int
*
xp
,
int
*
yp
)
{
...
...
@@ -1193,25 +1166,25 @@ static void gatom_getwherelabel(t_gatom *x, t_glist *glist, int *xp, int *yp)
text_getrect
(
&
x
->
a_text
.
te_g
,
glist
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
if
(
x
->
a_wherelabel
==
ATOM_LABELLEFT
)
{
*
xp
=
3
-
*
xp
=
-
3
-
strlen
(
canvas_realizedollar
(
x
->
a_glist
,
x
->
a_label
)
->
s_name
)
*
sys_fontwidth
(
glist_getfont
(
glist
));
*
yp
=
2
+
sys_fontheight
(
glist_getfont
(
glist
))
;
*
yp
=
y
2
-
y1
-
4
;
}
else
if
(
x
->
a_wherelabel
==
ATOM_LABELRIGHT
)
{
*
xp
=
x2
-
x1
+
2
;
*
yp
=
y2
-
y1
+
2
;
*
xp
=
x2
-
x1
+
3
;
*
yp
=
y2
-
y1
-
4
;
}
else
if
(
x
->
a_wherelabel
==
ATOM_LABELUP
)
{
*
xp
=
-
1
;
*
yp
=
-
1
;
*
yp
=
-
3
;
}
else
{
*
xp
=
-
1
;
*
yp
=
y2
-
y1
+
3
;
*
yp
=
y2
-
y1
+
sys_fontheight
(
glist_getfont
(
glist
))
;
}
}
...
...
@@ -1248,15 +1221,13 @@ static void gatom_vis(t_gobj *z, t_glist *glist, int vis)
// canvas_realizedollar(x->a_glist, x->a_label)->s_name,
// sys_hostfontsize(glist_getfont(glist)),
// "$pd_colors(text)");
gui_vmess
(
"gui_text_new"
,
"sssiii
ii
si"
,
gui_vmess
(
"gui_text_new"
,
"sssiiisi"
,
canvas_tag
(
glist_getcanvas
(
glist
)),
rtext_gettag
(
y
),
"gatom"
,
0
,
x1
,
// left margin
y1
,
// top margin
0
,
// bottom margin
sys_fontwidth
(
glist_getfont
(
glist
)),
canvas_realizedollar
(
x
->
a_glist
,
x
->
a_label
)
->
s_name
,
sys_hostfontsize
(
glist_getfont
(
glist
))
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment