mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-08 00:05:00 +00:00
Correctly set the dimensions of the SVG foreignObject container for the Vello canvas (#1907)
* Correctly set the dimensons of the forgein object element * Remove dead code * Fix missing default impl * Set correct default for not wasm32 targets as well
This commit is contained in:
parent
f21c8c1b17
commit
00864e274f
2 changed files with 17 additions and 20 deletions
|
@ -110,6 +110,8 @@ fn render_svg(data: impl GraphicElementRendered, mut render: SvgRender, render_p
|
|||
#[cfg(feature = "vello")]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), allow(dead_code))]
|
||||
async fn render_canvas(render_config: RenderConfig, data: impl GraphicElementRendered, editor: &WasmEditorApi, surface_handle: wgpu_executor::WgpuSurface) -> RenderOutput {
|
||||
use graphene_core::SurfaceFrame;
|
||||
|
||||
if let Some(exec) = editor.application_io.as_ref().unwrap().gpu_executor() {
|
||||
use vello::*;
|
||||
|
||||
|
@ -129,11 +131,12 @@ async fn render_canvas(render_config: RenderConfig, data: impl GraphicElementRen
|
|||
} else {
|
||||
unreachable!("Attempted to render with Vello when no GPU executor is available");
|
||||
}
|
||||
let frame = graphene_core::application_io::SurfaceHandleFrame {
|
||||
surface_handle,
|
||||
let frame = SurfaceFrame {
|
||||
surface_id: surface_handle.window_id,
|
||||
resolution: render_config.viewport.resolution,
|
||||
transform: glam::DAffine2::IDENTITY,
|
||||
};
|
||||
RenderOutput::CanvasFrame(frame.into())
|
||||
RenderOutput::CanvasFrame(frame)
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue