mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-18 18:31:02 +03:00
Preserve thin cursor proportions at the visibility minimum
This commit is contained in:
@@ -2915,19 +2915,11 @@ class CursorData {
|
||||
debugPrint('Rejected cursor $id: invalid scale $scale');
|
||||
return null;
|
||||
}
|
||||
if (!useLegacyMinimum) {
|
||||
// Preserve unscaled legacy artwork, but never enlarge a thin cursor just
|
||||
// to make its short edge reach the visibility minimum.
|
||||
if (!useLegacyMinimum || scale != 1.0) {
|
||||
scale = max(scale, kMinCursorSize / max(width, height));
|
||||
}
|
||||
if (useLegacyMinimum && scale != 1.0) {
|
||||
// Update data if scale changed.
|
||||
final tgtWidth = width * scale;
|
||||
final tgtHeight = height * scale;
|
||||
if (tgtWidth < kMinCursorSize || tgtHeight < kMinCursorSize) {
|
||||
double sw = kMinCursorSize.toDouble() / width;
|
||||
double sh = kMinCursorSize.toDouble() / height;
|
||||
scale = sw < sh ? sh : sw;
|
||||
}
|
||||
}
|
||||
|
||||
if (!_validCursorRasterSize(width * scale, height * scale,
|
||||
rasterScale: rasterScale)) {
|
||||
|
||||
Reference in New Issue
Block a user