Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ zoom-factor = 1.1
text-move-length = 50.0
# experimental feature (0.20.1): Scale factor on the input image when it was taken (e.g. DPI scale on the monitor it was recorded from).
# This may be more useful to set via the command line.
# Note, this is ignored with explicit resize.
# Note, before NEXTRELEASE this is ignored with explicit resize.
input-scale = 2.0
# experimental feature (NEXTRELEASE): set window title
title = "Satty"
Expand Down Expand Up @@ -308,11 +308,11 @@ Options:
--text-move-length <TEXT_MOVE_LENGTH>
Experimental feature (0.20.1): The length to move the text when using the arrow keys. defaults to 50.0
--input-scale <INPUT_SCALE>
Experimental feature (0.20.1): Scale the default window size to fit different displays. Note that this is ignored with explicit resize
Experimental feature (0.20.1): Scale the default window size to fit different displays. Note that before NEXTRELEASE this is ignored with explicit resize
--title <TITLE>
Experimental feature (NEXTRELEASE): Set window title
--app-id <APP_ID>
Experimental feature (NEXTRELEASE): Set toplevel app_id. Note that this applies gtk format expectations
Experimental feature (NEXTRELEASE): Set toplevel app_id. Note that this has to match D-Bus well known name format, otherwise GTK does not accept it
--right-click-copy
Right click to copy. Preferably use the `action_on_right_click` option instead
--action-on-enter <ACTION_ON_ENTER>
Expand Down
2 changes: 1 addition & 1 deletion cli/src/command_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub struct CommandLine {
#[arg(long)]
pub text_move_length: Option<f32>,

/// Experimental feature (0.20.1): Scale the default window size to fit different displays. Note that this is ignored with explicit resize.
/// Experimental feature (0.20.1): Scale the default window size to fit different displays. Note that before NEXTRELEASE this is ignored with explicit resize.
#[arg(long)]
pub input_scale: Option<f32>,

Expand Down
10 changes: 5 additions & 5 deletions src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub struct Configuration {
zoom_factor: f32,
pan_step_size: f32,
text_move_length: f32,
input_scale: f32,
input_scale: Option<f32>,
title: Option<String>,
app_id: Option<String>,
}
Expand Down Expand Up @@ -352,7 +352,7 @@ impl Configuration {
self.text_move_length = v;
}
if let Some(v) = general.input_scale {
self.input_scale = v;
self.input_scale = Some(v);
}
if let Some(v) = general.title {
self.title = Some(v);
Expand Down Expand Up @@ -488,7 +488,7 @@ impl Configuration {
self.text_move_length = v;
}
if let Some(v) = command_line.input_scale {
self.input_scale = v;
self.input_scale = Some(v);
}
if let Some(v) = command_line.title {
self.title = Some(v);
Expand Down Expand Up @@ -643,7 +643,7 @@ impl Configuration {
self.text_move_length
}

pub fn input_scale(&self) -> f32 {
pub fn input_scale(&self) -> Option<f32> {
self.input_scale
}

Expand Down Expand Up @@ -691,7 +691,7 @@ impl Default for Configuration {
zoom_factor: 1.1,
pan_step_size: 50.,
text_move_length: 50.0,
input_scale: 1.0,
input_scale: None,
title: None,
app_id: None,
}
Expand Down
5 changes: 3 additions & 2 deletions src/femtovg_area/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ impl FemtoVGArea {
active_tool: Rc<RefCell<dyn Tool>>,
background_image: Pixbuf,
) {
let initial_scale = APP_CONFIG.read().input_scale().unwrap_or(0.0);
self.inner().replace(FemtoVgAreaMut {
background_image,
background_image_id: None,
Expand All @@ -172,11 +173,11 @@ impl FemtoVGArea {
offset: Vec2D::zero(),
drawables: Vec::new(),
redo_stack: Vec::new(),
zoom_scale: 0.0,
zoom_scale: initial_scale,
pointer_offset: Vec2D::zero(),
last_offset: Vec2D::zero(),
drag_offset: Vec2D::zero(),
last_scale: 0.0,
last_scale: initial_scale,
is_drag: false,
is_reset: false,
});
Expand Down
9 changes: 5 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ impl App {
}

fn resize_window_initial(&self, root: &Window, sender: ComponentSender<Self>) {
let scale = APP_CONFIG.read().input_scale();
let fullscreen = APP_CONFIG.read().fullscreen();
let resize = APP_CONFIG.read().resize();
let floating_hack = APP_CONFIG.read().floating_hack();
let config = APP_CONFIG.read();
let scale = config.input_scale().unwrap_or(1.0);
let fullscreen = config.fullscreen();
let resize = config.resize();
let floating_hack = config.floating_hack();

let image_width = (self.image_dimensions.0 as f32 / scale) as f64;
let image_height = (self.image_dimensions.1 as f32 / scale) as f64;
Expand Down
Loading