Update to latest dvui.

This commit is contained in:
andrew.kraevskii
2026-03-04 00:22:46 +03:00
parent 9ca360c6b3
commit 3348b2e91c
5 changed files with 19 additions and 16 deletions

View File

@@ -172,7 +172,7 @@ pub fn example(self: CpuRenderEngine, canvas_size: Size_i, visible_rect: Rect_i)
.Squares => self.renderSquares(pixels, canvas_size, visible_rect),
}
return try dvui.textureCreate(pixels, width, height, .nearest);
return try dvui.textureCreate(pixels, width, height, .nearest, .rgba_8_8_8_8);
}
pub fn renderEngine(self: *CpuRenderEngine) RenderEngine {
@@ -191,7 +191,7 @@ pub fn renderDocument(self: *CpuRenderEngine, document: *const Document, canvas_
try cpu_draw.drawDocument(pixels, width, height, visible_rect, document, canvas_size, self._allocator);
self._renderStats.render_time_ns = t.read();
return try dvui.textureCreate(pixels, width, height, .nearest);
return try dvui.textureCreate(pixels, width, height, .nearest, .rgba_8_8_8_8);
}
pub fn getStats(self: CpuRenderEngine) RenderStats {

View File

@@ -17,14 +17,15 @@ pub fn canvasView(canvas: *Canvas, selected_object_id: ?u64, content_rect_scale:
var overlay = dvui.overlay(@src(), .{ .expand = .both });
{
const overlay_parent = dvui.parentGet();
const init_options: dvui.ScrollAreaWidget.InitOpts = .{
.scroll_info = &canvas.scroll,
.vertical_bar = .auto,
.horizontal_bar = .auto,
.process_events_after = false,
};
var scroll = dvui.scrollArea(
@src(),
.{
.scroll_info = &canvas.scroll,
.vertical_bar = .auto,
.horizontal_bar = .auto,
.process_events_after = false,
},
init_options,
.{
.expand = .both,
.background = false,
@@ -100,7 +101,7 @@ pub fn canvasView(canvas: *Canvas, selected_object_id: ?u64, content_rect_scale:
}
}
if (!scroll.init_opts.process_events_after) {
if (!init_options.process_events_after) {
if (scroll.scroll) |*sc| {
dvui.clipSet(sc.prevClip);
sc.processEventsAfter();

View File

@@ -222,11 +222,13 @@ pub fn leftPanel(ctx: *WindowContext) void {
},
);
{
dvui.label(@src(), "Objects", .{}, .{ .font = .{
.id = dvui.themeGet().font_heading.id,
.line_height_factor = dvui.themeGet().font_heading.line_height_factor,
.size = dvui.themeGet().font_heading.size + 8,
}, .gravity_x = 0.5 });
dvui.label(@src(), "Objects", .{}, .{
.font = .{
.line_height_factor = dvui.themeGet().font_heading.line_height_factor,
.size = dvui.themeGet().font_heading.size + 8,
},
.gravity_x = 0.5,
});
var scroll = dvui.scrollArea(
@src(),
.{ .vertical = .auto, .horizontal = .auto },