Skip to main content
Participating Frequently
Feb 2, 2009 6:13 AM UTC
Answered

Resize image without disturbing undo-redo

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 is closed to new replies. Start a new post to keep the conversation going.
rdermerCorrect answer
Inspiring
Feb 4, 2009 9:49 PM UTC
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

6 replies

rdermerCorrect answer
Inspiring
Feb 4, 2009 9:49 PM UTC
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
Translate
Participating Frequently
Feb 9, 2009 5:32 AM UTC
OK thanks Richard for putting maximum size settings idea logged for enhancement.
Translate
Inspiring
Feb 2, 2009 9:32 PM UTC
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


Translate
Participating Frequently
Feb 3, 2009 5:06 AM UTC
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.
Translate
Inspiring
Feb 3, 2009 5:53 AM UTC
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
Translate