Stay organized with collections
Save and categorize content based on your preferences.
blockly > Events > ViewportChange > (constructor)
Events.ViewportChange.(constructor)
Constructs a new instance of the ViewportChange
class
Signature:
constructor(opt_top?: number, opt_left?: number, opt_scale?: number, opt_workspaceId?: string, opt_oldScale?: number);
Parameters
Parameter |
Type |
Description |
opt_top |
number |
(Optional) Top-edge of the visible portion of the workspace, relative to the workspace origin. Undefined for a blank event. |
opt_left |
number |
(Optional) Left-edge of the visible portion of the workspace relative to the workspace origin. Undefined for a blank event. |
opt_scale |
number |
(Optional) The scale of the workspace. Undefined for a blank event. |
opt_workspaceId |
string |
(Optional) The workspace identifier for this event. Undefined for a blank event. |
opt_oldScale |
number |
(Optional) The old scale of the workspace. Undefined for a blank event. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[],["The `ViewportChange` class constructor creates a new instance to represent changes in the workspace's view. It accepts optional parameters: `opt_top` (top edge position), `opt_left` (left edge position), `opt_scale` (current scale), `opt_workspaceId` (workspace identifier), and `opt_oldScale` (previous scale). These parameters detail the new position and zoom level of the visible workspace area, with the options being undefined when the constructor is called with a blank event.\n"]]