Ограничение частоты перерисовки до 20 фпс
This commit is contained in:
@@ -189,6 +189,9 @@ fn gui_frame(ctx: *WindowContext) bool {
|
||||
canvas.updateVisibleImageRect(viewport_px, scroll_px) catch |err| {
|
||||
std.debug.print("updateVisibleImageRect error: {}\n", .{err});
|
||||
};
|
||||
canvas.processPendingRedraw() catch |err| {
|
||||
std.debug.print("processPendingRedraw error: {}\n", .{err});
|
||||
};
|
||||
|
||||
const content_w_px: u32 = img_size.x + img_size.w;
|
||||
const content_h_px: u32 = img_size.y + img_size.h;
|
||||
@@ -237,7 +240,7 @@ fn gui_frame(ctx: *WindowContext) bool {
|
||||
switch (action) {
|
||||
.wheel_y => |y| {
|
||||
canvas.addZoom(y / 1000);
|
||||
canvas.redrawExample() catch {};
|
||||
canvas.requestRedraw();
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user