gemini feat: optimize drawing performance by caching layer styles during strokes and improve UI/UX for layer styles and menus, improved drop shadow
This commit is contained in:
@@ -67,9 +67,9 @@ pub(crate) fn generate_shadow(
|
||||
}
|
||||
|
||||
// MAE-optimized against Krita ground truth (768 samples, 350 combos, 800x800)
|
||||
// Best: blur_factor=5.0, passes=5, spread_scale=0.00
|
||||
// Since spread_scale is 0.00, we apply 0.0 spread to offset_alpha.
|
||||
apply_spread(&mut offset_alpha, spread * 0.00);
|
||||
// Best: blur_factor=5.0, passes=5, spread_scale=1.00
|
||||
// Actually use the spread parameter (0.0 to 100.0) from the user
|
||||
apply_spread(&mut offset_alpha, spread);
|
||||
|
||||
let radius = size.max(0.0).round() as i32;
|
||||
if radius > 0 {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/// blurring, and masking with the original alpha. MAE-optimized
|
||||
/// parameters for Photoshop-compatible output.
|
||||
|
||||
use crate::helpers::box_blur_f32;
|
||||
use crate::helpers::{apply_spread, box_blur_f32};
|
||||
|
||||
/// Generate an inner shadow buffer.
|
||||
///
|
||||
@@ -38,7 +38,7 @@ pub(crate) fn generate_inner_shadow(
|
||||
h: u32,
|
||||
angle: f32,
|
||||
distance: f32,
|
||||
_choke: f32,
|
||||
choke: f32,
|
||||
size: f32,
|
||||
color: [u8; 4],
|
||||
) -> Vec<u8> {
|
||||
@@ -64,6 +64,8 @@ pub(crate) fn generate_inner_shadow(
|
||||
}
|
||||
}
|
||||
|
||||
apply_spread(&mut offset_alpha, choke);
|
||||
|
||||
let radius = size.max(0.0).round() as i32;
|
||||
if radius > 0 {
|
||||
let gaussian_r = (radius as f32 / 10.0).round().max(1.0) as i32;
|
||||
|
||||
Reference in New Issue
Block a user