Merge pull request #3433 from fufesou/refact/canvas_pos_size

mobile, canvas size
This commit is contained in:
RustDesk 2023-02-28 22:33:33 +08:00 committed by GitHub
commit c22043b0f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 12 deletions

View File

@ -458,10 +458,8 @@ class InputModel {
return;
}
evt['type'] = type;
if (isDesktop) {
y -= CanvasModel.topToEdge;
x -= CanvasModel.leftToEdge;
}
y -= CanvasModel.topToEdge;
x -= CanvasModel.leftToEdge;
final canvasModel = parent.target!.canvasModel;
final nearThr = 3;
var nearRight = (canvasModel.size.width - x) < nearThr;

View File

@ -727,14 +727,18 @@ class CanvasModel with ChangeNotifier {
double get scrollX => _scrollX;
double get scrollY => _scrollY;
static double get leftToEdge =>
windowBorderWidth + kDragToResizeAreaPadding.left;
static double get rightToEdge =>
windowBorderWidth + kDragToResizeAreaPadding.right;
static double get topToEdge =>
tabBarHeight + windowBorderWidth + kDragToResizeAreaPadding.top;
static double get bottomToEdge =>
windowBorderWidth + kDragToResizeAreaPadding.bottom;
static double get leftToEdge => (isDesktop || isWebDesktop)
? windowBorderWidth + kDragToResizeAreaPadding.left
: 0;
static double get rightToEdge => (isDesktop || isWebDesktop)
? windowBorderWidth + kDragToResizeAreaPadding.right
: 0;
static double get topToEdge => (isDesktop || isWebDesktop)
? tabBarHeight + windowBorderWidth + kDragToResizeAreaPadding.top
: 0;
static double get bottomToEdge => (isDesktop || isWebDesktop)
? windowBorderWidth + kDragToResizeAreaPadding.bottom
: 0;
updateViewStyle() async {
Size getSize() {