@native-sdk/cli 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/app.zig +50 -1
- package/build.zig +534 -3
- package/build.zig.zon +7 -0
- package/native-sdk.d.ts +3 -1
- package/package.json +9 -9
- package/packages/core/package-lock.json +2 -2
- package/packages/core/package.json +1 -1
- package/packages/core/rt/rt.zig +280 -8
- package/packages/core/sdk/core.ts +481 -2
- package/packages/core/sdk/events.ts +17 -8
- package/packages/core/src/checker.ts +305 -2
- package/packages/core/src/diagnostics.ts +12 -0
- package/packages/core/src/emitter.ts +599 -3
- package/packages/core/src/typed_ast.ts +51 -4
- package/packages/core/src/types.ts +34 -1
- package/skill-data/native-ui/SKILL.md +39 -2
- package/skill-data/ts-core/SKILL.md +4 -2
- package/src/app_runner/root.zig +32 -10
- package/src/automation/layout_fingerprint.zig +160 -0
- package/src/automation/protocol.zig +82 -33
- package/src/automation/root.zig +1 -0
- package/src/automation/server.zig +1 -1
- package/src/automation/snapshot.zig +68 -9
- package/src/automation/watcher.zig +1 -1
- package/src/embed/host.zig +5 -0
- package/src/embed/ui_host.zig +13 -0
- package/src/platform/linux/gtk_host.c +527 -13
- package/src/platform/linux/gtk_host.h +25 -0
- package/src/platform/linux/root.zig +280 -7
- package/src/platform/macos/appkit_host.h +104 -6
- package/src/platform/macos/appkit_host.m +1283 -66
- package/src/platform/macos/cef_host.mm +110 -1
- package/src/platform/macos/root.zig +287 -7
- package/src/platform/null_platform.zig +398 -4
- package/src/platform/null_platform_tests.zig +35 -0
- package/src/platform/root.zig +9 -0
- package/src/platform/types.zig +386 -14
- package/src/platform/windows/root.zig +298 -9
- package/src/platform/windows/webview2_host.cpp +330 -5
- package/src/primitives/app_manifest/validation.zig +18 -0
- package/src/primitives/canvas/a11y_audit.zig +33 -11
- package/src/primitives/canvas/a11y_audit_tests.zig +20 -0
- package/src/primitives/canvas/drawing.zig +25 -0
- package/src/primitives/canvas/equality.zig +8 -0
- package/src/primitives/canvas/events.zig +103 -16
- package/src/primitives/canvas/frame.zig +125 -1
- package/src/primitives/canvas/layout_audit.zig +22 -5
- package/src/primitives/canvas/markdown_hostile_tests.zig +8 -4
- package/src/primitives/canvas/render_tests.zig +13 -10
- package/src/primitives/canvas/root.zig +48 -0
- package/src/primitives/canvas/terminal_box.zig +471 -0
- package/src/primitives/canvas/terminal_grid.zig +978 -0
- package/src/primitives/canvas/terminal_grid_tests.zig +1093 -0
- package/src/primitives/canvas/test_support.zig +1 -0
- package/src/primitives/canvas/tests.zig +1 -0
- package/src/primitives/canvas/text_tests.zig +39 -4
- package/src/primitives/canvas/tokens.zig +115 -12
- package/src/primitives/canvas/ui.zig +524 -5
- package/src/primitives/canvas/ui_markup.zig +195 -2
- package/src/primitives/canvas/ui_markup_compiled.zig +172 -1
- package/src/primitives/canvas/ui_markup_compiled_tests.zig +133 -8
- package/src/primitives/canvas/ui_markup_contract.zig +88 -5
- package/src/primitives/canvas/ui_markup_contract_tests.zig +39 -1
- package/src/primitives/canvas/ui_markup_huge_model_tests.zig +1 -0
- package/src/primitives/canvas/ui_markup_reflect.zig +75 -24
- package/src/primitives/canvas/ui_markup_tests.zig +149 -0
- package/src/primitives/canvas/ui_markup_view.zig +191 -0
- package/src/primitives/canvas/ui_markup_view_tests.zig +403 -19
- package/src/primitives/canvas/ui_schema.zig +97 -17
- package/src/primitives/canvas/ui_schema_tests.zig +18 -11
- package/src/primitives/canvas/ui_tests.zig +141 -9
- package/src/primitives/canvas/widget_access.zig +28 -2
- package/src/primitives/canvas/widget_anchored_tests.zig +48 -0
- package/src/primitives/canvas/widget_invalidation.zig +81 -1
- package/src/primitives/canvas/widget_layout.zig +59 -11
- package/src/primitives/canvas/widget_layout_tests.zig +125 -4
- package/src/primitives/canvas/widget_render.zig +272 -18
- package/src/primitives/canvas/widget_render_scroll.zig +108 -27
- package/src/primitives/canvas/widget_routing.zig +59 -7
- package/src/primitives/canvas/widget_runtime.zig +23 -0
- package/src/primitives/canvas/widget_runtime_tests.zig +149 -0
- package/src/primitives/canvas/widget_semantics.zig +119 -11
- package/src/primitives/canvas/widget_semantics_tests.zig +409 -0
- package/src/primitives/canvas/widget_tree.zig +17 -0
- package/src/primitives/canvas/widgets.zig +132 -0
- package/src/root.zig +16 -0
- package/src/runtime/api.zig +70 -1
- package/src/runtime/automation_commands.zig +20 -1
- package/src/runtime/automation_snapshot.zig +25 -1
- package/src/runtime/automation_widget_dispatch.zig +73 -8
- package/src/runtime/bridge_payload.zig +1 -0
- package/src/runtime/canvas_frame.zig +62 -7
- package/src/runtime/canvas_frame_animation_tests.zig +5 -4
- package/src/runtime/canvas_frame_helpers.zig +190 -1
- package/src/runtime/canvas_frame_invalidation_tests.zig +531 -0
- package/src/runtime/canvas_frame_patch_tests.zig +161 -10
- package/src/runtime/canvas_frame_retained_tests.zig +5 -2
- package/src/runtime/canvas_widget_accessibility_tests.zig +1 -1
- package/src/runtime/canvas_widget_clipboard_tests.zig +40 -0
- package/src/runtime/canvas_widget_context_menu.zig +269 -32
- package/src/runtime/canvas_widget_context_menu_tests.zig +640 -14
- package/src/runtime/canvas_widget_display.zig +1 -1
- package/src/runtime/canvas_widget_event_tests.zig +1823 -0
- package/src/runtime/canvas_widget_events.zig +240 -24
- package/src/runtime/canvas_widget_runtime.zig +213 -29
- package/src/runtime/canvas_widget_scroll_driver_tests.zig +170 -7
- package/src/runtime/canvas_widget_scroll_drivers.zig +151 -17
- package/src/runtime/canvas_widget_scroll_tests.zig +435 -23
- package/src/runtime/canvas_widget_state.zig +6 -0
- package/src/runtime/canvas_widget_text_tests.zig +1 -1
- package/src/runtime/core.zig +73 -2
- package/src/runtime/effects.zig +6389 -54
- package/src/runtime/effects_channel_tests.zig +3519 -0
- package/src/runtime/effects_pty_tests.zig +1362 -0
- package/src/runtime/effects_tests.zig +14 -9
- package/src/runtime/effects_video_tests.zig +3609 -0
- package/src/runtime/flow.zig +25 -4
- package/src/runtime/gpu_surface_events.zig +473 -13
- package/src/runtime/media_surface.zig +116 -11
- package/src/runtime/media_surface_tests.zig +61 -0
- package/src/runtime/pty.zig +1252 -0
- package/src/runtime/pty_windows.zig +1780 -0
- package/src/runtime/root.zig +25 -0
- package/src/runtime/runtime_event_tests.zig +20 -1
- package/src/runtime/session_journal.zig +367 -61
- package/src/runtime/session_record.zig +16 -0
- package/src/runtime/session_replay.zig +395 -11
- package/src/runtime/session_tests.zig +109 -15
- package/src/runtime/terminal_session.zig +1569 -0
- package/src/runtime/terminal_session_tests.zig +450 -0
- package/src/runtime/terminal_vt_ghostty.zig +15 -0
- package/src/runtime/terminal_vt_stub.zig +13 -0
- package/src/runtime/tests.zig +6 -0
- package/src/runtime/ts_core_host.zig +980 -140
- package/src/runtime/ts_core_host_tests.zig +1059 -1
- package/src/runtime/ts_ui_app.zig +16 -5
- package/src/runtime/ui_app.zig +2333 -63
- package/src/runtime/ui_app_tests.zig +3171 -744
- package/src/runtime/ui_app_virtual_variable_tests.zig +4 -2
- package/src/runtime/ui_app_window_tests.zig +268 -0
- package/src/runtime/view.zig +190 -2
- package/src/runtime/view_widget_scroll.zig +218 -68
- package/src/runtime/view_widget_text.zig +11 -2
- package/src/runtime/view_widget_tree.zig +111 -3
- package/src/runtime/window_storage.zig +45 -2
- package/src/runtime/window_view_runtime.zig +34 -2
- package/src/runtime/window_views.zig +1 -0
- package/src/terminal_session_tests_root.zig +15 -0
- package/src/tooling/templates.zig +25 -7
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
//! record and the existing "runtime offset wins until the source
|
|
18
18
|
//! changes" rebuild reconciliation keeps working unchanged.
|
|
19
19
|
//!
|
|
20
|
-
//! `
|
|
21
|
-
//! the last driver-reported offset
|
|
22
|
-
//! source-side programmatic scroll,
|
|
23
|
-
//!
|
|
20
|
+
//! `set_offset_x`/`set_offset_y` are only forced when that axis's
|
|
21
|
+
//! runtime offset diverged from the last driver-reported offset
|
|
22
|
+
//! (keyboard scroll, automation wheel, source-side programmatic scroll,
|
|
23
|
+
//! clamp after content shrink): pushing unconditionally — or pushing
|
|
24
|
+
//! the OTHER axis along for the ride — would snap the OS scroller back
|
|
25
|
+
//! mid-gesture.
|
|
24
26
|
|
|
25
27
|
const std = @import("std");
|
|
26
28
|
const geometry = @import("geometry");
|
|
@@ -66,8 +68,53 @@ pub fn RuntimeCanvasWidgetScrollDrivers(comptime Runtime: type) type {
|
|
|
66
68
|
|
|
67
69
|
var drivers: [platform.max_gpu_surface_scroll_drivers]platform.GpuSurfaceScrollDriver = undefined;
|
|
68
70
|
var ids: [platform.max_gpu_surface_scroll_drivers]u64 = undefined;
|
|
69
|
-
var offsets: [platform.max_gpu_surface_scroll_drivers]
|
|
71
|
+
var offsets: [platform.max_gpu_surface_scroll_drivers]geometry.OffsetF = undefined;
|
|
70
72
|
var count: usize = 0;
|
|
73
|
+
// Occluders: floating surfaces and modal catchers that
|
|
74
|
+
// hit-block regions beneath them, so the host's geometric
|
|
75
|
+
// wheel routing declines exactly the points the engine's
|
|
76
|
+
// hit test would give to an overlay's branch. Anchored
|
|
77
|
+
// TOOLTIPS are excluded (they pass hit-testing through),
|
|
78
|
+
// as are surfaces hidden by an ancestor or concealed by a
|
|
79
|
+
// closed disclosure — the same visibility rules the hit
|
|
80
|
+
// test applies. Frames honor the widget's render transform
|
|
81
|
+
// (a sliding popover blocks where it is SEEN), and a modal
|
|
82
|
+
// catcher spans the whole VIEW-LOCAL canvas only when it is
|
|
83
|
+
// actually modal (`scrim` — the false case is the inline
|
|
84
|
+
// preview, which floats over nothing). More surfaces than
|
|
85
|
+
// the budget fails SAFE: one whole-view occluder blocking
|
|
86
|
+
// every driver, so every wheel rides the wire and the
|
|
87
|
+
// engine's real hit test decides.
|
|
88
|
+
var occluders: [platform.max_gpu_surface_scroll_occluders]platform.GpuSurfaceScrollOccluder = undefined;
|
|
89
|
+
var occluder_nodes: [platform.max_gpu_surface_scroll_occluders]usize = undefined;
|
|
90
|
+
var occluder_count: usize = 0;
|
|
91
|
+
var occluder_overflow = false;
|
|
92
|
+
const layout_tree = view.widgetLayoutTree();
|
|
93
|
+
const view_local = geometry.RectF.init(0, 0, view.frame.normalized().width, view.frame.normalized().height);
|
|
94
|
+
for (view.widget_layout_nodes[0..view.widget_layout_node_count], 0..) |*node, node_index| {
|
|
95
|
+
const anchored_surface = node.widget.layout.anchor != null and node.widget.kind != .tooltip;
|
|
96
|
+
const modal_surface = switch (node.widget.kind) {
|
|
97
|
+
.dialog, .drawer, .sheet => node.widget.scrim,
|
|
98
|
+
else => false,
|
|
99
|
+
};
|
|
100
|
+
if (!anchored_surface and !modal_surface) continue;
|
|
101
|
+
if (node.widget.semantics.hidden) continue;
|
|
102
|
+
if (canvas.isWidgetHiddenInAncestors(layout_tree, node_index)) continue;
|
|
103
|
+
if (canvas.isWidgetConcealedByDisclosure(layout_tree, node_index)) continue;
|
|
104
|
+
const frame = if (modal_surface) view_local else transformedOccluderFrame(node.*);
|
|
105
|
+
if (frame.isEmpty()) continue;
|
|
106
|
+
if (occluder_count >= occluders.len) {
|
|
107
|
+
occluder_overflow = true;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
occluders[occluder_count] = .{ .frame = frame };
|
|
111
|
+
occluder_nodes[occluder_count] = node_index;
|
|
112
|
+
occluder_count += 1;
|
|
113
|
+
}
|
|
114
|
+
if (occluder_overflow) {
|
|
115
|
+
occluders[0] = .{ .frame = view_local };
|
|
116
|
+
occluder_count = 1;
|
|
117
|
+
}
|
|
71
118
|
for (view.widget_layout_nodes[0..view.widget_layout_node_count], 0..) |*node, node_index| {
|
|
72
119
|
if (!canvasWidgetScrollDriverEligible(node.*)) continue;
|
|
73
120
|
node.widget.native_scroll = true;
|
|
@@ -80,30 +127,52 @@ pub fn RuntimeCanvasWidgetScrollDrivers(comptime Runtime: type) type {
|
|
|
80
127
|
// Content extent is viewport-relative; rebase it onto the
|
|
81
128
|
// full region frame so the native max offset
|
|
82
129
|
// (content_height - frame.height) matches the engine's
|
|
83
|
-
// (content_extent - viewport.height).
|
|
84
|
-
|
|
85
|
-
|
|
130
|
+
// (content_extent - viewport.height). Each dimension
|
|
131
|
+
// exceeds the frame only on an axis the region grants;
|
|
132
|
+
// everywhere else it pins to the frame so the OS
|
|
133
|
+
// scroller cannot travel along a revoked axis (a
|
|
134
|
+
// horizontal-only shelf with tall content must not
|
|
135
|
+
// accept vertical wheel motion natively).
|
|
136
|
+
const content_height = if (canvas.widgetScrollsAxis(node.widget, .vertical))
|
|
137
|
+
frame.height + @max(0, content_extent - viewport.height)
|
|
138
|
+
else
|
|
139
|
+
frame.height;
|
|
140
|
+
const content_width = if (canvas.widgetScrollsAxis(node.widget, .horizontal))
|
|
141
|
+
frame.width + @max(0, view.canvasWidgetScrollContentExtentX(node_index, viewport) - viewport.width)
|
|
142
|
+
else
|
|
143
|
+
frame.width;
|
|
144
|
+
const offset = geometry.OffsetF.init(
|
|
145
|
+
if (canvas.widgetScrollsAxis(node.widget, .horizontal)) node.widget.value_x else 0,
|
|
146
|
+
if (canvas.widgetScrollsAxis(node.widget, .vertical)) node.widget.value else 0,
|
|
147
|
+
);
|
|
86
148
|
const tracked = trackedScrollDriverOffset(view, node.widget.id);
|
|
87
|
-
const
|
|
149
|
+
const push_x = tracked == null or @abs(tracked.?.dx - offset.dx) > scroll_driver_offset_epsilon;
|
|
150
|
+
const push_y = tracked == null or @abs(tracked.?.dy - offset.dy) > scroll_driver_offset_epsilon;
|
|
88
151
|
|
|
89
152
|
drivers[count] = .{
|
|
90
153
|
.id = node.widget.id,
|
|
154
|
+
.parent_id = nearestAncestorDriverId(view, node_index),
|
|
155
|
+
.occluder_mask = if (occluder_overflow) 1 else driverOccluderMask(view, node_index, occluder_nodes[0..occluder_count]),
|
|
91
156
|
.frame = frame,
|
|
92
|
-
.content_size = .{ .width =
|
|
93
|
-
.
|
|
94
|
-
.
|
|
157
|
+
.content_size = .{ .width = content_width, .height = content_height },
|
|
158
|
+
.offset_x = offset.dx,
|
|
159
|
+
.offset_y = offset.dy,
|
|
160
|
+
.set_offset_x = push_x,
|
|
161
|
+
.set_offset_y = push_y,
|
|
95
162
|
// Per-region edge behavior, resolved the same way the
|
|
96
163
|
// engine physics resolve it (region override onto the
|
|
97
164
|
// scroll-physics token): off pins the OS scroller at
|
|
98
165
|
// the content edges, on lets it bounce.
|
|
99
166
|
.rubber_band = canvas.widgetScrollPhysics(node.widget, view.widget_tokens.scroll).overscroll == .rubber_band,
|
|
167
|
+
.scrolls_x = canvas.widgetScrollsAxis(node.widget, .horizontal),
|
|
168
|
+
.scrolls_y = canvas.widgetScrollsAxis(node.widget, .vertical),
|
|
100
169
|
};
|
|
101
170
|
ids[count] = node.widget.id;
|
|
102
171
|
offsets[count] = offset;
|
|
103
172
|
count += 1;
|
|
104
173
|
}
|
|
105
174
|
|
|
106
|
-
self.options.platform.services.setGpuSurfaceScrollDrivers(view.window_id, view.label, drivers[0..count]) catch |err| {
|
|
175
|
+
self.options.platform.services.setGpuSurfaceScrollDrivers(view.window_id, view.label, drivers[0..count], occluders[0..occluder_count]) catch |err| {
|
|
107
176
|
if (err != error.UnsupportedService) {
|
|
108
177
|
scroll_driver_log.warn("scroll driver sync failed for view '{s}': {s}", .{ view.label, @errorName(err) });
|
|
109
178
|
}
|
|
@@ -122,10 +191,10 @@ pub fn RuntimeCanvasWidgetScrollDrivers(comptime Runtime: type) type {
|
|
|
122
191
|
const index = runtimeFindViewIndex(self, event.window_id, event.label) orelse return;
|
|
123
192
|
if (self.views[index].kind != .gpu_surface) return;
|
|
124
193
|
self.views[index].recordGpuSurfaceInputTimestamp(event.timestamp_ns);
|
|
125
|
-
recordScrollDriverOffset(&self.views[index], event.driver_id, event.offset_y);
|
|
194
|
+
recordScrollDriverOffset(&self.views[index], event.driver_id, geometry.OffsetF.init(event.offset_x, event.offset_y));
|
|
126
195
|
|
|
127
196
|
const node_index = self.views[index].canvasWidgetNodeIndexById(event.driver_id) orelse return;
|
|
128
|
-
const dirty = try self.views[index].applyCanvasWidgetScrollDriverOffset(node_index, event.offset_y) orelse return;
|
|
197
|
+
const dirty = try self.views[index].applyCanvasWidgetScrollDriverOffset(node_index, event.offset_x, event.offset_y) orelse return;
|
|
129
198
|
|
|
130
199
|
const previous_cursor = self.views[index].canvas_widget_cursor;
|
|
131
200
|
try CanvasWidgetEventMethods().reconcileCanvasWidgetRenderStateAfterScrollWithTooltipIntent(self, index, null);
|
|
@@ -165,14 +234,79 @@ pub fn canvasWidgetScrollDriverEligible(node: canvas.WidgetLayoutNode) bool {
|
|
|
165
234
|
return true;
|
|
166
235
|
}
|
|
167
236
|
|
|
168
|
-
|
|
237
|
+
/// Which occluders block this driver. An occluder never blocks:
|
|
238
|
+
/// - ITSELF (a directly anchored scroll region is its own surface);
|
|
239
|
+
/// - its own subtree (a scroll region inside an open popover or
|
|
240
|
+
/// modal is above the surface, not beneath it);
|
|
241
|
+
/// - a driver whose anchored ROOT paints LATER in the floating pass
|
|
242
|
+
/// (anchored surfaces paint in tree order above all in-flow
|
|
243
|
+
/// content, so a scroll region inside the topmost of two
|
|
244
|
+
/// overlapping popovers sits above the lower one).
|
|
245
|
+
fn driverOccluderMask(view: anytype, driver_node: usize, occluder_nodes: []const usize) u32 {
|
|
246
|
+
const driver_anchor_root = anchoredRootIndex(view, driver_node);
|
|
247
|
+
var mask: u32 = 0;
|
|
248
|
+
for (occluder_nodes, 0..) |occluder_node, bit| {
|
|
249
|
+
if (occluder_node == driver_node) continue;
|
|
250
|
+
if (driver_anchor_root) |root| {
|
|
251
|
+
if (occluder_node == root) continue;
|
|
252
|
+
if (root > occluder_node) continue;
|
|
253
|
+
}
|
|
254
|
+
if (nodeIsAncestor(view, occluder_node, driver_node)) continue;
|
|
255
|
+
mask |= @as(u32, 1) << @intCast(bit);
|
|
256
|
+
}
|
|
257
|
+
return mask;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/// The render transform honored: the occluder blocks where the surface
|
|
261
|
+
/// is SEEN (the transformed frame's axis-aligned bounds), not where it
|
|
262
|
+
/// was laid out.
|
|
263
|
+
fn transformedOccluderFrame(node: canvas.WidgetLayoutNode) geometry.RectF {
|
|
264
|
+
const frame = node.frame.normalized();
|
|
265
|
+
if (frame.isEmpty()) return frame;
|
|
266
|
+
const transform = node.widget.transform;
|
|
267
|
+
if (std.meta.eql(transform, canvas.Affine.identity())) return frame;
|
|
268
|
+
return transform.transformRect(frame).normalized();
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/// The nearest self-or-ancestor node that is an anchored floating root,
|
|
272
|
+
/// or null for in-flow content.
|
|
273
|
+
fn anchoredRootIndex(view: anytype, node_index: usize) ?usize {
|
|
274
|
+
var current: ?usize = node_index;
|
|
275
|
+
while (current) |index| {
|
|
276
|
+
if (view.widget_layout_nodes[index].widget.layout.anchor != null) return index;
|
|
277
|
+
current = view.widget_layout_nodes[index].parent_index;
|
|
278
|
+
}
|
|
279
|
+
return null;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
fn nodeIsAncestor(view: anytype, ancestor: usize, node: usize) bool {
|
|
283
|
+
var current = view.widget_layout_nodes[node].parent_index;
|
|
284
|
+
while (current) |index| {
|
|
285
|
+
if (index == ancestor) return true;
|
|
286
|
+
current = view.widget_layout_nodes[index].parent_index;
|
|
287
|
+
}
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/// The widget id of the nearest ancestor node that is itself
|
|
292
|
+
/// driver-eligible, or 0 at the top of the scrollable chain.
|
|
293
|
+
fn nearestAncestorDriverId(view: anytype, node_index: usize) u64 {
|
|
294
|
+
var current = view.widget_layout_nodes[node_index].parent_index;
|
|
295
|
+
while (current) |index| {
|
|
296
|
+
if (canvasWidgetScrollDriverEligible(view.widget_layout_nodes[index])) return view.widget_layout_nodes[index].widget.id;
|
|
297
|
+
current = view.widget_layout_nodes[index].parent_index;
|
|
298
|
+
}
|
|
299
|
+
return 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
fn trackedScrollDriverOffset(view: anytype, driver_id: u64) ?geometry.OffsetF {
|
|
169
303
|
for (view.scroll_driver_ids[0..view.scroll_driver_count], 0..) |id, index| {
|
|
170
304
|
if (id == driver_id) return view.scroll_driver_offsets[index];
|
|
171
305
|
}
|
|
172
306
|
return null;
|
|
173
307
|
}
|
|
174
308
|
|
|
175
|
-
fn recordScrollDriverOffset(view: anytype, driver_id: u64, offset:
|
|
309
|
+
fn recordScrollDriverOffset(view: anytype, driver_id: u64, offset: geometry.OffsetF) void {
|
|
176
310
|
for (view.scroll_driver_ids[0..view.scroll_driver_count], 0..) |id, index| {
|
|
177
311
|
if (id != driver_id) continue;
|
|
178
312
|
view.scroll_driver_offsets[index] = offset;
|