Scripts: each view is sized as the area its document was last drawn in

Since the move to the craft UI framework each document's view keeps the
area it last drew the document in, so Document.views now gives a view
for every document the app has drawn, in a tab, a tiled pane or a
floating window, sized as that area. A document the app has not drawn
yet has no view. View and Views also get toString, as the other script
objects have.
This commit is contained in:
dotCooCoo committed 2026-11-25 01:06:23 -08:00
1 parent a303ef2283
commit 98a6ed7fc7
6 files changed
+32 -32

No files matched your search

+2
View File
@@ -2305,6 +2305,7 @@ pub(super) fn install(realm: &mut Realm, link: &Link) -> std::result::Result<(),
("length", get(l, views_length)),
("parent", get(l, views_parent)),
("index", method(l, views_index)),
("toString", class_text("Views")),
]),
Some(function(l, views_at)),
));
@@ -2318,6 +2319,7 @@ pub(super) fn install(realm: &mut Realm, link: &Link) -> std::result::Result<(),
("centerPoint", property(l, view_center, view_set_center)),
("zoom", property(l, view_zoom, view_set_zoom)),
("screenMode", property(l, view_screen_mode, view_set_screen_mode)),
("toString", class_text("View")),
]),
None,
));