Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
edit_paste pastes at incorrect location after scaling
#2
(Yesterday, 01:41 PM)class43 Wrote: Then, I scale the image to a new width.

No, you scale another image (image, not image1).

Otherwise you have to anchor the floating selections, somethng like this (instead of scaling whatever image, this code copy-pastes halves): 

Code:
strip_Y=100
strip_width = image1.get_width()/2
strip_height=40
       
image1.select_rectangle(Gimp.ChannelOps.REPLACE, 0, strip_Y, strip_width, strip_height)
image1_dr = image1.get_selected_drawables()
Gimp.edit_copy(image1_dr)

image1.select_rectangle(Gimp.ChannelOps.REPLACE, 0, strip_Y, strip_width, strip_height)
floating_selections=Gimp.edit_paste(image1_dr[0], True)
Gimp.floating_sel_anchor(floating_selections[0])

image1.select_rectangle(Gimp.ChannelOps.REPLACE, strip_width, strip_Y, strip_width, strip_height)
floating_selections=Gimp.edit_paste(image1_dr[0], True)
Gimp.floating_sel_anchor(floating_selections[0])
Reply


Messages In This Thread
RE: edit_paste pastes at incorrect location after scaling - by Ofnuts - 9 hours ago

Forum Jump: