ResizeState (widget/widgetresize)
@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate
Stores the internal state of a single resizable object.
Filtering
Properties
-
readonly observable
activeHandlePosition : String | null
module:widget/widgetresize/resizerstate~ResizeState#activeHandlePosition
The position of the handle that initiated the resizing. E.g.
"top-left"
,"bottom-right"
etc. ornull
if unknown. -
A width to height ratio of the resized image.
-
The original height (pixels) of the resized object when the resize process was started.
-
The original width (pixels) of the resized object when the resize process was started.
-
readonly
originalWidthPercents : Number
module:widget/widgetresize/resizerstate~ResizeState#originalWidthPercents
The original width (percents) of the resized object when the resize process was started.
-
readonly observable
proposedHeightPixels : Number | null
module:widget/widgetresize/resizerstate~ResizeState#proposedHeightPixels
The height (pixels) proposed, but not committed yet, in the current resize process.
-
readonly observable
proposedWidthPercents : Number | null
module:widget/widgetresize/resizerstate~ResizeState#proposedWidthPercents
The width (percents) proposed, but not committed yet, in the current resize process.
-
readonly observable
proposedWidthPixels : Number | null
module:widget/widgetresize/resizerstate~ResizeState#proposedWidthPixels
The width (pixels) proposed, but not committed yet, in the current resize process.
-
private
_referenceCoordinates : Object
module:widget/widgetresize/resizerstate~ResizeState#_referenceCoordinates
The reference point of the resizer where the dragging started. It is used to measure the distance the user cursor traveled, so how much the image should be enlarged. This information is only known after the DOM was rendered, so it will be updated later.
Methods
-
constructor( options )
module:widget/widgetresize/resizerstate~ResizeState#constructor
-
begin( domResizeHandle, domHandleHost, domResizeHost )
module:widget/widgetresize/resizerstate~ResizeState#begin
Parameters
domResizeHandle : HTMLElement
The handle used to calculate the reference point.
domHandleHost : HTMLElement
domResizeHost : HTMLElement
Events
-
change:activeHandlePosition( eventInfo, name, value, oldValue )
module:widget/widgetresize/resizerstate~ResizeState#event:change:activeHandlePosition
Fired when the
activeHandlePosition
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
activeHandlePosition
).value : String | null
New value of the
activeHandlePosition
property with given key ornull
, if operation should remove property.oldValue : String | null
Old value of the
activeHandlePosition
property with given key ornull
, if property was not set before.
-
change:proposedHeightPixels( eventInfo, name, value, oldValue )
module:widget/widgetresize/resizerstate~ResizeState#event:change:proposedHeightPixels
Fired when the
proposedHeightPixels
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
proposedHeightPixels
).value : Number | null
New value of the
proposedHeightPixels
property with given key ornull
, if operation should remove property.oldValue : Number | null
Old value of the
proposedHeightPixels
property with given key ornull
, if property was not set before.
-
change:proposedWidthPercents( eventInfo, name, value, oldValue )
module:widget/widgetresize/resizerstate~ResizeState#event:change:proposedWidthPercents
Fired when the
proposedWidthPercents
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
proposedWidthPercents
).value : Number | null
New value of the
proposedWidthPercents
property with given key ornull
, if operation should remove property.oldValue : Number | null
Old value of the
proposedWidthPercents
property with given key ornull
, if property was not set before.
-
change:proposedWidthPixels( eventInfo, name, value, oldValue )
module:widget/widgetresize/resizerstate~ResizeState#event:change:proposedWidthPixels
Fired when the
proposedWidthPixels
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
proposedWidthPixels
).value : Number | null
New value of the
proposedWidthPixels
property with given key ornull
, if operation should remove property.oldValue : Number | null
Old value of the
proposedWidthPixels
property with given key ornull
, if property was not set before.
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.