move debounce out of match

This commit is contained in:
Daniel Holth 2022-07-28 07:46:22 -04:00
parent 972e3ae069
commit ffbd5b256f
1 changed files with 6 additions and 6 deletions

View File

@ -485,15 +485,15 @@ fn paint_drag_on_panel(&self, ctx: &mut PaintCtx, data: &LapceTabData) {
fn paint_drag(&self, ctx: &mut PaintCtx, data: &LapceTabData) {
if let Some((offset, start, drag_content)) = data.drag.as_ref() {
if (self.mouse_pos.x - start.x).abs() < 5.
&& (self.mouse_pos.y - start.y).abs() < 5.
{
// debounce accidental drags
return;
}
match drag_content {
DragContent::EditorTab(_, _, _, tab_rect) => {
let rect = tab_rect.rect.with_origin(self.mouse_pos - *offset);
if (self.mouse_pos.x - start.x).abs() < 5.
&& (self.mouse_pos.y - start.y).abs() < 5.
{
// debounce accidental drags
return;
}
let size = rect.size();
let shadow_width = data.config.ui.drop_shadow_width() as f64;
if shadow_width > 0.0 {