Refactor and enhance various components across the application
- Removed obsolete plans for stroke tuning, commit regression gate, and wxPlainSlider port. - Updated scrollable panel functionality to include optional scrollbar visibility. - Enhanced brush panel to filter brush styles by category for improved user experience. - Adjusted canvas rendering logic to prevent UI freezes during active drawing. - Modified stroke brush logic to allow single dab drawing at the current position when no movement occurs.
This commit is contained in:
@@ -98,11 +98,17 @@ impl Engine {
|
||||
if Self::is_specialized_style(tip.style) {
|
||||
if let Some((lx, ly, lp)) = self.last_stroke_pos {
|
||||
if let Some(layer) = self.document.get_layer_by_id_mut(layer_id) {
|
||||
// If click without movement, draw a single dab at current position
|
||||
let points_vec = if (lx - x).abs() < 0.001 && (ly - y).abs() < 0.001 {
|
||||
vec![(x, y, pressure)]
|
||||
} else {
|
||||
vec![(lx, ly, lp), (x, y, pressure)]
|
||||
};
|
||||
draw_specialized_stroke(
|
||||
&mut layer.pixels,
|
||||
layer.width,
|
||||
layer.height,
|
||||
&[(lx, ly, lp), (x, y, pressure)],
|
||||
&points_vec,
|
||||
tip.style,
|
||||
tip.size,
|
||||
tip.hardness,
|
||||
|
||||
Reference in New Issue
Block a user