mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 03:18:06 +08:00
Fix eyedropped not working on raster data when canvas is used
This commit is contained in:
@@ -243,6 +243,7 @@ pub struct RenderConfig {
|
||||
pub view_mode: ViewMode,
|
||||
pub hide_artboards: bool,
|
||||
pub for_export: bool,
|
||||
pub disable_canvas_override: bool
|
||||
}
|
||||
|
||||
struct Logger;
|
||||
|
||||
@@ -245,6 +245,7 @@ where
|
||||
let resolution = footprint.resolution;
|
||||
let render_params = RenderParams {
|
||||
culling_bounds: None,
|
||||
disable_canvas_override: false,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@@ -311,7 +312,12 @@ async fn render<'a: 'n, T: 'n + GraphicElementRendered + WasmNotSend>(
|
||||
.into_context();
|
||||
ctx.footprint();
|
||||
|
||||
let RenderConfig { hide_artboards, for_export, .. } = render_config;
|
||||
let RenderConfig {
|
||||
hide_artboards,
|
||||
for_export,
|
||||
disable_canvas_override,
|
||||
..
|
||||
} = render_config;
|
||||
let render_params = RenderParams {
|
||||
view_mode: render_config.view_mode,
|
||||
culling_bounds: None,
|
||||
@@ -320,6 +326,7 @@ async fn render<'a: 'n, T: 'n + GraphicElementRendered + WasmNotSend>(
|
||||
for_export,
|
||||
for_mask: false,
|
||||
alignment_parent_transform: None,
|
||||
disable_canvas_override,
|
||||
};
|
||||
|
||||
let data = data.eval(ctx.clone()).await;
|
||||
|
||||
@@ -163,8 +163,10 @@ pub struct RenderParams {
|
||||
pub for_export: bool,
|
||||
/// Are we generating a mask in this render pass? Used to see if fill should be multiplied with alpha.
|
||||
pub for_mask: bool,
|
||||
/// Are we generating a mask for alignment? Used to prevent unnecesary transforms in masks
|
||||
/// Are we generating a mask for alignment? Used to prevent unnecesary transforms in masks.
|
||||
pub alignment_parent_transform: Option<DAffine2>,
|
||||
/// Whether or not if rendering image data via the canvas should be disabled forcefully. Currently it only checks for eyedropper.
|
||||
pub disable_canvas_override: bool,
|
||||
}
|
||||
|
||||
impl RenderParams {
|
||||
@@ -178,7 +180,7 @@ impl RenderParams {
|
||||
}
|
||||
|
||||
pub fn to_canvas(&self) -> bool {
|
||||
!self.for_export && !self.thumbnail && !self.for_mask
|
||||
!self.disable_canvas_override && !self.for_export && !self.thumbnail && !self.for_mask
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user