Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
blockly > Events > ViewportChange
Class Events.ViewportChange
Memberi tahu pemroses bahwa posisi atau skala platform ruang kerja telah berubah.
Tidak memberi tahu saat ruang kerja itu sendiri mengubah ukurannya.
Tanda Tangan:
export declare class ViewportChange extends UiBase
Memperluas: UiBase
Konstruktor
Properti
Properti |
Pengubah |
Jenis |
Deskripsi |
oldScale? |
|
angka |
(Opsional) Skala ruang kerja sebelumnya. |
skala? |
|
angka |
(Opsional) Skala ruang kerja. |
jenis |
|
EventType |
|
viewLeft? |
|
angka |
(Opsional) Tepi kiri bagian ruang kerja yang terlihat, relatif terhadap asal ruang kerja. |
viewTop? |
|
angka |
(Opsional) Tepi atas bagian ruang kerja yang terlihat, relatif terhadap asal ruang kerja. |
Metode
Metode |
Pengubah |
Deskripsi |
toJson() |
|
Enkode peristiwa sebagai JSON. |
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-05-16 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-05-16 UTC."],[[["The `ViewportChange` event is triggered when the workspace view changes, such as panning or zooming."],["This event provides information about the new and previous scale and position of the workspace view."],["It does not trigger when the workspace itself resizes, only when the visible area changes."],["Developers can use this event to react to workspace view changes and update UI elements accordingly."]]],["The `ViewportChange` class notifies listeners about changes to the workspace surface's position or scale, excluding workspace resizing. It extends the `UiBase` class. Key properties include `oldScale`, `scale`, `viewLeft`, and `viewTop`, representing the previous and current scale, and the visible portion's edges, respectively. The class's constructor creates new instances, and the `toJson()` method encodes the event into JSON format. Its purpose is to inform of changes in what the user see.\n"]]