Skip to main content
Participating Frequently
February 2, 2009
Answered

Resize image without disturbing undo-redo

  • February 2, 2009
  • 2 replies
  • 1038 views
Hi,
I want to resize the image if its larger than a max-size. For this in the listener of "StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGED" I've modified the graphics's width and height. But then undoManager doen't undo operations performed before this image resize.
If I resize image using editManager.modifyInlineGraphic() then in undo-stack an extra operation will be added.
Any suggestions for resizing image on load so that undo-redo doesn't disturb.

Thanks,
Ahmed
This topic has been closed for replies.
Correct answer rdermer
Good point - adjusting the graphic only solves the issue with the size of the graphic.

I'll get the maximum size settings idea logged as an enhancement request.

Richard

2 replies

rdermerCorrect answer
Adobe Employee
February 4, 2009
Good point - adjusting the graphic only solves the issue with the size of the graphic.

I'll get the maximum size settings idea logged as an enhancement request.

Richard
Participating Frequently
February 9, 2009
OK thanks Richard for putting maximum size settings idea logged for enhancement.
Adobe Employee
February 2, 2009
The way the undo/redo mechanism work if you make changes outside operations we can't let undo run on the previous operation. Changes to the model outside of operations invalidate the undo stack by design. There's no way we can perform the undo reliably in the presence of external model changes.

Richard


Participating Frequently
February 3, 2009
Thanks Richard. But don't you think it is a common scenario for an editor that to limit the newly inserted image dimensions (without any effect on undo/redo). If u can tell any workaround for this I'll be very thankful.

Ahmed.
Adobe Employee
February 3, 2009
The solution that would fit into the model would be a settable maximum image size on InlineGraphicElement.

Another possibility is that you could apply a scale to the underlying graphic.

Richard