Skip to content

Commit

Permalink
refactor(area_selector/view_port): make selection size a const
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaDve committed Feb 12, 2024
1 parent 02c9157 commit a5fbdf8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/area_selector/view_port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use std::{
// * Add minimum selection size.

const DEFAULT_SIZE: f64 = 100.0;
const DEFAULT_SELECTION_SIZE: f32 = 40.0;

const SHADE_COLOR: gdk::RGBA = gdk::RGBA::new(0.0, 0.0, 0.0, 0.5);

Expand Down Expand Up @@ -797,7 +798,7 @@ impl ViewPort {
&& selection.end_x == selection.start_x
&& selection.end_y == selection.start_y
{
let offset = 20.0;
let offset = DEFAULT_SELECTION_SIZE / 2.0;
selection.start_x -= offset;
selection.start_y -= offset;
selection.end_x += offset;
Expand Down

0 comments on commit a5fbdf8

Please sign in to comment.