Skip to content

Commit

Permalink
fix: mobile view style, on conn (rustdesk#9786)
Browse files Browse the repository at this point in the history
Signed-off-by: fufesou <[email protected]>
  • Loading branch information
fufesou authored Oct 30, 2024
1 parent 32dbc0c commit 0b8cccd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 1 addition & 7 deletions flutter/lib/models/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1275,13 +1275,6 @@ class ImageModel with ChangeNotifier {
if (isDesktop || isWebDesktop) {
await parent.target?.canvasModel.updateViewStyle();
await parent.target?.canvasModel.updateScrollStyle();
} else {
final size = MediaQueryData.fromWindow(ui.window).size;
final canvasWidth = size.width;
final canvasHeight = size.height;
final xscale = canvasWidth / image.width;
final yscale = canvasHeight / image.height;
parent.target?.canvasModel.scale = min(xscale, yscale);
}
if (parent.target != null) {
await initializeCursorAndCanvas(parent.target!);
Expand Down Expand Up @@ -1679,6 +1672,7 @@ class CanvasModel with ChangeNotifier {
_x = 0;
_y = 0;
_scale = 1.0;
_lastViewStyle = ViewStyle.defaultViewStyle();
}

updateScrollPercent() {
Expand Down
3 changes: 3 additions & 0 deletions libs/hbb_common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,9 @@ impl UserDefaultConfig {

pub fn get(&self, key: &str) -> String {
match key {
#[cfg(any(target_os = "android", target_os = "ios"))]
keys::OPTION_VIEW_STYLE => self.get_string(key, "adaptive", vec!["original"]),
#[cfg(not(any(target_os = "android", target_os = "ios")))]
keys::OPTION_VIEW_STYLE => self.get_string(key, "original", vec!["adaptive"]),
keys::OPTION_SCROLL_STYLE => self.get_string(key, "scrollauto", vec!["scrollbar"]),
keys::OPTION_IMAGE_QUALITY => {
Expand Down

0 comments on commit 0b8cccd

Please sign in to comment.