Class

ResizeState (widget/widgetresize)

@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate

class

Stores the internal state of a single resizable object.

Filtering

Properties

  • activeHandlePosition : String | null

    readonly observable

    The position of the handle that initiated the resizing. E.g. "top-left", "bottom-right" etc. or null if unknown.

  • aspectRatio : Number

    readonly

    A width to height ratio of the resized image.

  • originalHeight : Number

    readonly

    The original height (pixels) of the resized object when the resize process was started.

  • originalWidth : Number

    readonly

    The original width (pixels) of the resized object when the resize process was started.

  • originalWidthPercents : Number

    readonly

    The original width (percents) of the resized object when the resize process was started.

  • proposedHeightPixels : Number | null

    readonly observable

    The height (pixels) proposed, but not committed yet, in the current resize process.

  • proposedWidthPercents : Number | null

    readonly observable

    The width (percents) proposed, but not committed yet, in the current resize process.

  • proposedWidthPixels : Number | null

    readonly observable

    The width (pixels) proposed, but not committed yet, in the current resize process.

  • _options : ResizerOptions

    private

  • _referenceCoordinates : Object

    private

    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 )

    Parameters

    options : ResizerOptions

    Resizer options.

  • begin( domResizeHandle, domHandleHost, domResizeHost )

    Parameters

    domResizeHandle : HTMLElement

    The handle used to calculate the reference point.

    domHandleHost : HTMLElement
    domResizeHost : HTMLElement

Events

  • change:activeHandlePosition( eventInfo, name, value, oldValue )

    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 or null, if operation should remove property.

    oldValue : String | null

    Old value of the activeHandlePosition property with given key or null, if property was not set before.

  • change:proposedHeightPixels( eventInfo, name, value, oldValue )

    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 or null, if operation should remove property.

    oldValue : Number | null

    Old value of the proposedHeightPixels property with given key or null, if property was not set before.

  • change:proposedWidthPercents( eventInfo, name, value, oldValue )

    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 or null, if operation should remove property.

    oldValue : Number | null

    Old value of the proposedWidthPercents property with given key or null, if property was not set before.

  • change:proposedWidthPixels( eventInfo, name, value, oldValue )

    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 or null, if operation should remove property.

    oldValue : Number | null

    Old value of the proposedWidthPixels property with given key or null, if property was not set before.