Skip to content

Commit c16d1ea

Browse files
committed
Let a brush paint from the first frame of a stroke
Every stroke opened with an isolated dot: the press applied one dab, then the 0.3s initial delay blocked the next 300ms of motion, so the line only began well after the cursor had moved on. Drop the concept rather than shorten it. Metal and grass already overrode it to zero, so a brush now repeats purely at apply_delay(), which scales with brush area and floors at 10ms.
1 parent 26910a4 commit c16d1ea

3 files changed

Lines changed: 1 addition & 18 deletions

File tree

native/src/sbc/grass/brushes.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ impl MapBrush for Grass {
1212
fn name(&self) -> &'static str {
1313
"grass"
1414
}
15-
fn initial_delay(&self) -> f32 {
16-
0.0
17-
}
18-
1915
fn prepare(
2016
&self,
2117
brush: &BrushSettings,

native/src/sbc/metal/brushes.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ impl MapBrush for Metal {
1212
fn name(&self) -> &'static str {
1313
"metal"
1414
}
15-
fn initial_delay(&self) -> f32 {
16-
0.0
17-
}
18-
1915
fn prepare(
2016
&self,
2117
brush: &BrushSettings,

native/src/sbc/states/map_editing.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ impl BrushButton {
5454
pub(crate) trait MapBrush: Sync {
5555
fn name(&self) -> &'static str;
5656

57-
fn initial_delay(&self) -> f32 {
58-
0.3
59-
}
60-
6157
/// Whether the current domain settings can produce a command.
6258
fn is_ready(&self, _brush: &BrushSettings) -> bool {
6359
true
@@ -114,7 +110,6 @@ pub(crate) struct MapEditingState {
114110
/// Screen position paired with `last_hit`, in the ray-trace convention.
115111
last_screen: Option<(f32, f32)>,
116112
last_apply: Option<Instant>,
117-
initial_delay_left: f32,
118113
preview: BrushPreview,
119114
}
120115

@@ -128,7 +123,6 @@ impl MapEditingState {
128123
last_hit: None,
129124
last_screen: None,
130125
last_apply: None,
131-
initial_delay_left: tool.initial_delay(),
132126
preview: BrushPreview::new(),
133127
}
134128
}
@@ -155,10 +149,8 @@ impl MapEditingState {
155149
self.last_apply = Some(now);
156150
return true;
157151
};
158-
let delay = self.apply_delay().max(self.initial_delay_left);
159-
if now.duration_since(last).as_secs_f32() >= delay {
152+
if now.duration_since(last).as_secs_f32() >= self.apply_delay() {
160153
self.last_apply = Some(now);
161-
self.initial_delay_left = 0.0;
162154
return true;
163155
}
164156
false
@@ -168,7 +160,6 @@ impl MapEditingState {
168160
if self.painting {
169161
return;
170162
}
171-
self.initial_delay_left = self.tool.initial_delay();
172163
ctx.set_multiple_command_mode(true);
173164
self.painting = true;
174165
}

0 commit comments

Comments
 (0)