Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/canvas-c/src/c2d/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ pub fn resize_gl(context: &mut CanvasRenderingContext2D, width: f32, height: f32
context.clear_rect(0., 0., width, height);
context.flush_and_render_to_surface();

// The view's layer changed size; its drawable follows, and is what the surface wraps.
#[cfg(any(target_os = "ios", target_os = "visionos", target_os = "tvos"))]
if let Some(gl) = context.gl_context.as_mut() {
gl.resize_drawable(width as i32, height as i32);
gl.bind_drawable();
}

unsafe {
gl_bindings::Viewport(0, 0, width as i32, height as i32);
match context.window_framebuffer() {
Expand Down
Loading
Loading