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
d5a1d7fe
Commit
d5a1d7fe
authored
Apr 16, 2011
by
Ivica Bukvic
Committed by
Hans-Christoph Steiner
Nov 02, 2011
Browse files
Pd-0.42.5-extended-l2ork-dev-20110416.tar.bz2
parent
9887d05d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/g_editor.c
View file @
d5a1d7fe
...
...
@@ -3275,18 +3275,38 @@ static void canvas_paste_atmouse(t_canvas *x)
}
extern
void
canvas_obj
(
t_glist
*
gl
,
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
);
extern
void
canvas_howputnew
(
t_canvas
*
x
,
int
*
connectp
,
int
*
xpixp
,
int
*
ypixp
,
int
*
indexp
,
int
*
totalp
);
static
void
canvas_dopaste
(
t_canvas
*
x
,
t_binbuf
*
b
)
{
//fprintf(stderr,"start dopaste\n");
t_gobj
*
newgobj
,
*
last
,
*
g2
;
int
dspstate
=
canvas_suspend_dsp
(),
nbox
,
count
;
//autopatching variables
int
connectme
,
xpix
,
ypix
,
indx
,
nobj
;
connectme
=
0
;
canvas_editmode
(
x
,
1
.);
/* abolish potential displacing of object that may have been
created with the first new object on canvas, but now we are
pasting and therefore MA_MOVE should not apply to new objects
*/
x
->
gl_editor
->
e_onmotion
=
MA_NONE
;
//if we have something selected in another canvas
if
(
c_selection
&&
c_selection
!=
x
)
glist_noselect
(
c_selection
);
else
glist_noselect
(
x
);
//else is we are not duplicating but pasting see if we can autopatch
else
if
(
canvas_undo_name
[
0
]
!=
'd'
)
{
canvas_howputnew
(
x
,
&
connectme
,
&
xpix
,
&
ypix
,
&
indx
,
&
nobj
);
//glist_noselect(x);
}
//else we are duplicating
else
glist_noselect
(
x
);
for
(
g2
=
x
->
gl_list
,
nbox
=
0
;
g2
;
g2
=
g2
->
g_next
)
nbox
++
;
/* found the end of the queue */
...
...
@@ -3310,6 +3330,23 @@ static void canvas_dopaste(t_canvas *x, t_binbuf *b)
paste_canvas
=
0
;
canvas_resume_dsp
(
dspstate
);
//if we are pasting only one object autoposition it below our selection
if
(
count
==
nbox
+
1
&&
connectme
)
{
canvas_connect
(
x
,
indx
,
0
,
nobj
,
0
);
//is this universally safe? I think so
t_text
*
z
=
(
t_text
*
)
x
->
gl_editor
->
e_selection
->
sel_what
;
z
->
te_xpix
=
xpix
;
z
->
te_ypix
=
ypix
;
//this would be an alternative way but how would we then figure out delta?
//canvas_displaceselection(x, xpix, ypix);
}
else
if
(
canvas_undo_name
[
0
]
!=
'd'
)
{
canvas_paste_atmouse
(
x
);
}
canvas_dirty
(
x
,
1
);
if
(
!
canvas_undo_name
||
canvas_undo_name
[
0
]
!=
'd'
)
{
canvas_redraw
(
x
);
...
...
@@ -3344,7 +3381,6 @@ static void canvas_paste(t_canvas *x)
"paste"
);
canvas_dopaste
(
x
,
copy_binbuf
);
//canvas_paste_xyoffset(x);
canvas_paste_atmouse
(
x
);
}
}
...
...
src/g_text.c
View file @
d5a1d7fe
...
...
@@ -142,7 +142,7 @@ static void canvas_objtext(t_glist *gl, int xpix, int ypix, int selected,
extern
int
sys_noautopatch
;
/* utility routine to figure out where to put a new text box from menu
and whether to connect to it automatically */
static
void
canvas_howputnew
(
t_canvas
*
x
,
int
*
connectp
,
int
*
xpixp
,
int
*
ypixp
,
void
canvas_howputnew
(
t_canvas
*
x
,
int
*
connectp
,
int
*
xpixp
,
int
*
ypixp
,
int
*
indexp
,
int
*
totalp
)
{
int
xpix
,
ypix
,
indx
=
0
,
nobj
=
0
,
n2
,
x1
,
x2
,
y1
,
y2
;
...
...
src/m_pd.h
View file @
d5a1d7fe
...
...
@@ -11,7 +11,7 @@ extern "C" {
#define PD_MAJOR_VERSION 0
#define PD_MINOR_VERSION 42
#define PD_BUGFIX_VERSION 5
#define PD_TEST_VERSION "extended-l2ork-2011041
3
"
#define PD_TEST_VERSION "extended-l2ork-2011041
6
"
/* old name for "MSW" flag -- we have to take it for the sake of many old
"nmakefiles" for externs, which will define NT and not MSW */
...
...
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