Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wynn
purr-data
Commits
b4ebfc59
Commit
b4ebfc59
authored
Dec 18, 2016
by
Jonathan Wilkes
Browse files
fix for
#201
: new subcanvas position isn't saved with patch
parent
f2f9ef2a
Changes
3
Show whitespace changes
Inline
Side-by-side
pd/nw/pd_canvas.js
View file @
b4ebfc59
...
...
@@ -630,6 +630,10 @@ var canvas_events = (function() {
gui
.
Window
.
get
().
on
(
"
blur
"
,
function
()
{
nw_window_blur_callback
(
name
);
});
gui
.
Window
.
get
().
on
(
"
move
"
,
function
(
x
,
y
)
{
var
w
=
gui
.
Window
.
get
();
pdgui
.
pdsend
(
name
,
"
setbounds
"
,
x
,
y
,
x
+
w
.
width
,
y
+
w
.
height
);
});
// set minimum window size
gui
.
Window
.
get
().
setMinimumSize
(
150
,
100
);
...
...
pd/src/g_canvas.c
View file @
b4ebfc59
...
...
@@ -51,7 +51,7 @@ t_canvas *canvas_whichfind; /* last canvas we did a find in */
static
void
canvas_start_dsp
(
void
);
static
void
canvas_stop_dsp
(
void
);
static
void
canvas_drawlines
(
t_canvas
*
x
);
void
canvas_setbounds
(
t_canvas
*
x
,
int
x1
,
int
y1
,
int
x2
,
int
y2
);
void
canvas_
do
setbounds
(
t_canvas
*
x
,
int
x1
,
int
y1
,
int
x2
,
int
y2
);
void
canvas_reflecttitle
(
t_canvas
*
x
);
static
void
canvas_addtolist
(
t_canvas
*
x
);
static
void
canvas_takeofflist
(
t_canvas
*
x
);
...
...
@@ -423,7 +423,7 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv)
x
->
gl_y1
=
0
;
x
->
gl_x2
=
1
;
x
->
gl_y2
=
1
;
canvas_setbounds
(
x
,
xloc
,
yloc
,
xloc
+
width
,
yloc
+
height
);
canvas_
do
setbounds
(
x
,
xloc
,
yloc
,
xloc
+
width
,
yloc
+
height
);
x
->
gl_owner
=
owner
;
x
->
gl_isclone
=
0
;
x
->
gl_name
=
(
*
s
->
s_name
?
s
:
...
...
@@ -609,9 +609,8 @@ int glist_isgraph(t_glist *x)
return
(
x
->
gl_isgraph
|
(
x
->
gl_hidetext
<<
1
));
}
/* This is sent from the GUI to inform a toplevel that its window has been
moved or resized. */
void
canvas_setbounds
(
t_canvas
*
x
,
int
x1
,
int
y1
,
int
x2
,
int
y2
)
/* bounds-setting for patch/subpatch windows */
void
canvas_dosetbounds
(
t_canvas
*
x
,
int
x1
,
int
y1
,
int
x2
,
int
y2
)
{
//fprintf(stderr,"canvas_setbounds %d %d %d %d\n", x1, y1, x2, y2);
...
...
@@ -643,6 +642,14 @@ void canvas_setbounds(t_canvas *x, int x1, int y1, int x2, int y2)
}
}
/* public method to set the bounds for a patch/subpatch window from the
GUI. */
static
void
canvas_setbounds
(
t_canvas
*
x
,
t_float
left
,
t_float
top
,
t_float
right
,
t_float
bottom
)
{
canvas_dosetbounds
(
x
,
(
int
)
left
,
(
int
)
top
,
(
int
)
right
,
(
int
)
bottom
);
}
t_symbol
*
canvas_makebindsym
(
t_symbol
*
s
)
{
char
buf
[
MAXPDSTRING
];
...
...
@@ -1247,7 +1254,7 @@ static void canvas_relocate(t_canvas *x, t_symbol *canvasgeom,
/* for some reason this is initially called with cw=ch=1 so
we just suppress that here. */
if
(
cw
>
5
&&
ch
>
5
)
canvas_setbounds
(
x
,
txpix
,
typix
,
canvas_
do
setbounds
(
x
,
txpix
,
typix
,
txpix
+
cw
,
typix
+
ch
);
/* readjust garrays (if any) */
t_gobj
*
g
;
...
...
@@ -2499,6 +2506,8 @@ void g_canvas_setup(void)
A_DEFFLOAT
,
A_NULL
);
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_loadbang
,
gensym
(
"loadbang"
),
A_NULL
);
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_setbounds
,
gensym
(
"setbounds"
),
A_FLOAT
,
A_FLOAT
,
A_FLOAT
,
A_FLOAT
,
A_NULL
);
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_relocate
,
gensym
(
"relocate"
),
A_SYMBOL
,
A_SYMBOL
,
A_NULL
);
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_vis
,
...
...
pd/src/g_editor.c
View file @
b4ebfc59
...
...
@@ -68,7 +68,6 @@ static int screeny2;
static
int
copiedfont
;
static
void
canvas_dofont
(
t_canvas
*
x
,
t_floatarg
font
,
t_floatarg
xresize
,
t_floatarg
yresize
);
extern
void
canvas_setbounds
(
t_canvas
*
x
,
int
x1
,
int
y1
,
int
x2
,
int
y2
);
int
canvas_apply_restore_original_position
(
t_canvas
*
x
,
int
orig_pos
);
extern
void
canvas_draw_gop_resize_hooks
(
t_canvas
*
x
);
static
void
canvas_font
(
t_canvas
*
x
,
t_floatarg
font
,
t_floatarg
oldfont
,
...
...
@@ -6237,8 +6236,6 @@ static void canvas_dopaste(t_canvas *x, t_binbuf *b)
x
->
gl_screenx2
=
screenx1
+
screenx2
;
x
->
gl_screeny1
=
screeny1
;
x
->
gl_screeny2
=
screeny1
+
screeny2
;
//canvas_setbounds(x, screenx1, screeny1,
// screenx1+screenx2, screeny1+screeny2);
gui_vmess
(
"gui_canvas_change_geometry"
,
"xiiii"
,
x
,
(
int
)(
x
->
gl_screenx2
-
x
->
gl_screenx1
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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