feat: compose interactive world ui across nested 3d viewports

This commit is contained in:
2026-11-11 00:08:23 +08:00
parent ad2c01bc29
commit 15fc01542c
27 changed files with 1412 additions and 84 deletions
+3 -6
View File
@@ -675,7 +675,7 @@ impl TesseraApp {
"viewport-pan"
}
.into(),
point: (kind == "page-zoom").then_some([world.x, world.y]),
point: Some([world.x, world.y]),
press_point: None,
delta: Some([
delta[0]
@@ -1254,11 +1254,6 @@ impl ApplicationHandler<AppEvent> for TesseraApp {
.and_then(|point| current.document.frame.camera_at(point))
.is_some_and(|mount| mount.scene3d_viewport)
});
if scene3d {
self.page_view("page-zoom", [(dy * 0.005).exp().clamp(0.1, 10.), 0.]);
window.request_redraw();
return;
}
let point = self.guest_point();
let input = point.and_then(|point| {
self.namespace.read().ok().and_then(|namespace| {
@@ -1284,6 +1279,8 @@ impl ApplicationHandler<AppEvent> for TesseraApp {
});
if let Some(input) = input {
self.send_guest(input);
} else if scene3d {
self.page_view("page-zoom", [(dy * 0.005).exp().clamp(0.1, 10.), 0.]);
} else {
let horizontal = self.namespace.read().is_ok_and(|n| {
n.document.frame.surface.mode == crate::page::Mode::Horizontal