intuitive_interface fix: only clicking on an instance (no drag) does not push to undo state

This commit is contained in:
stefan schippers 2024-03-15 15:53:38 +01:00
parent f7287f0c6c
commit 092f111925
2 changed files with 20 additions and 17 deletions

View File

@ -3971,7 +3971,8 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
#endif
}
if(! emb_ptr->image || cairo_surface_status(emb_ptr->image) != CAIRO_STATUS_SUCCESS) {
dbg(0, "draw_image(): failure creating image surface from \"image_data\" attribute\n");
if(jpg != 1)
dbg(0, "draw_image(): failure creating image surface from \"image_data\" attribute\n");
my_free(_ALLOC_ID_, &filter);
my_free(_ALLOC_ID_, &closure.buffer);
return;
@ -4018,7 +4019,8 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
#endif
}
if(! emb_ptr->image || cairo_surface_status(emb_ptr->image) != CAIRO_STATUS_SUCCESS) {
dbg(0, "draw_image(): failure creating image surface with filtered data from %s\n", filename);
if(jpg != 1)
dbg(0, "draw_image(): failure creating image surface with filtered data from %s\n", filename);
my_free(_ALLOC_ID_, &filter);
my_free(_ALLOC_ID_, &filedata);
my_free(_ALLOC_ID_, &filtered_img_data);
@ -4056,7 +4058,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
#endif
}
if(! emb_ptr->image || cairo_surface_status(emb_ptr->image) != CAIRO_STATUS_SUCCESS) {
dbg(0, "draw_image(): failure creating image surface from %s\n", filename);
if(jpg != 1) dbg(0, "draw_image(): failure creating image surface from %s\n", filename);
my_free(_ALLOC_ID_, &filter);
return;
}

View File

@ -558,20 +558,19 @@ void copy_objects(int what)
newpropcnt=0;
if( !xctx->kissing ) {
dbg(1, "copy_objects(): push undo state\n");
xctx->push_undo();
}
firstw = firsti = 1;
/* button released after clicking elements, without moving... do nothing */
if(xctx->drag_elements && xctx->deltax==0 && xctx->deltay == 0) {
xctx->ui_state &= ~STARTCOPY;
return;
}
if( !xctx->kissing ) {
dbg(1, "copy_objects(): push undo state\n");
xctx->push_undo();
}
/* calculate moving symbols bboxes before actually doing the copy */
firstw = firsti = 1;
draw_selection(xctx->gctiled,0);
update_symbol_bboxes(0, 0);
@ -954,7 +953,14 @@ void move_objects(int what, int merge, double dx, double dy)
xunlink(sel_file);
xctx->paste_from = 0; /* end of a paste from clipboard command */
if(xctx->connect_by_kissing == 2) xctx->connect_by_kissing = 0;
/* no undo push for MERGE ad PLACE and polygon point drag, already done before */
/* button released after clicking elements, without moving... do nothing */
if(xctx->drag_elements && xctx->deltax==0 && xctx->deltay == 0) {
xctx->ui_state &= ~STARTMOVE;
return;
}
/* no undo push for MERGE ad PLACE, already done before */
if(!xctx->kissing &&
!(xctx->ui_state & (STARTMERGE | PLACE_SYMBOL | PLACE_TEXT)) ) {
dbg(1, "move_objects(END): push undo state\n");
@ -973,11 +979,6 @@ void move_objects(int what, int merge, double dx, double dy)
}
/* calculate moving symbols bboxes before actually doing the move */
firsti = firstw = 1;
/* button released after clicking elements, without moving... do nothing */
if(xctx->drag_elements && xctx->deltax==0 && xctx->deltay == 0) {
xctx->ui_state &= ~STARTMOVE;
return;
}
draw_selection(xctx->gctiled,0);
update_symbol_bboxes(0, 0);
for(k=0;k<cadlayers; ++k)