feat: separate 2d scenes viewports and explicit cameras
This commit is contained in:
+8
-1
@@ -55,6 +55,7 @@ enum Query {
|
||||
ScrollBy,
|
||||
ScrollPosition,
|
||||
ScrollIntoView,
|
||||
FitView,
|
||||
Parent,
|
||||
FirstChild,
|
||||
NextSibling,
|
||||
@@ -99,6 +100,7 @@ impl NativeCallable for Method {
|
||||
| Query::ScrollTo
|
||||
| Query::ScrollBy
|
||||
| Query::ScrollIntoView
|
||||
| Query::FitView
|
||||
| Query::ScrollPosition
|
||||
)
|
||||
{
|
||||
@@ -133,6 +135,10 @@ impl NativeCallable for Method {
|
||||
crate::scroll::into_view(cx, self.owner, self.desktop)?;
|
||||
Value::Nil
|
||||
}
|
||||
Query::FitView => {
|
||||
crate::viewport::fit(cx, &mount)?;
|
||||
Value::Nil
|
||||
}
|
||||
Query::ScrollPosition => {
|
||||
let p = mount
|
||||
.geometry
|
||||
@@ -263,7 +269,7 @@ fn mount_signature(
|
||||
};
|
||||
let effect = if matches!(
|
||||
query,
|
||||
Query::ScrollTo | Query::ScrollBy | Query::ScrollIntoView | Query::Focus
|
||||
Query::ScrollTo | Query::ScrollBy | Query::ScrollIntoView | Query::FitView | Query::Focus
|
||||
) {
|
||||
CallEffect::Mutating
|
||||
} else {
|
||||
@@ -405,6 +411,7 @@ impl NativeCallable for Sync {
|
||||
("scrollBy", Query::ScrollBy),
|
||||
("scrollPosition", Query::ScrollPosition),
|
||||
("scrollIntoView", Query::ScrollIntoView),
|
||||
("fitView", Query::FitView),
|
||||
("parent", Query::Parent),
|
||||
("firstChild", Query::FirstChild),
|
||||
("nextSibling", Query::NextSibling),
|
||||
|
||||
Reference in New Issue
Block a user