blockly > Events > ViewportChange

Events.ViewportChange class

Notifies listeners that the workspace surface's position or scale has changed.

Does not notify when the workspace itself resizes.

Signature:

export declare class ViewportChange extends UiBase 

Extends: UiBase

Constructors

Constructor Modifiers Description
(constructor)(opt_top, opt_left, opt_scale, opt_workspaceId, opt_oldScale) Constructs a new instance of the ViewportChange class

Properties

Property Modifiers Type Description
oldScale? number (Optional) The previous scale of the workspace.
scale? number (Optional) The scale of the workpace.
type string
viewLeft? number (Optional) The left edge of the visible portion of the workspace, relative to the workspace origin.
viewTop? number (Optional) Top edge of the visible portion of the workspace, relative to the workspace origin.

Methods

Method Modifiers Description
toJson() Encode the event as JSON.