mcy_new #1

Merged
wangyang merged 179 commits from mcy_new into master 2025-08-28 10:10:45 +08:00
3 changed files with 24 additions and 8 deletions
Showing only changes of commit ed30fc6240 - Show all commits

View File

@ -429,11 +429,11 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
var zoomFile = zoomState.zoomFile.value!; var zoomFile = zoomState.zoomFile.value!;
// var imageHeightOffsetStart = zoomFile.imageHeightOffsetStart??0; // var imageHeightOffsetStart = zoomFile.imageHeightOffsetStart??0;
var imageHeightOffsetStart = zoomState.zoomFile.value!.getZoomFileOffsetStart(zoomState.initScale.value ?? 1); var imageHeightOffsetStart = zoomState.zoomFile.value!.getZoomFileOffsetStart(zoomState.initScale.value ?? 1);
print("位置:$localPosition; 图片所在位置:$imageHeightOffsetStart"); // print("位置:$localPosition; 图片所在位置:$imageHeightOffsetStart");
if (imageHeightOffsetStart == 0) return; if (imageHeightOffsetStart == 0) return;
var dy = localPosition.dy; var dy = localPosition.dy;
print(zoomFile.getZoomFileHeightOffsetEnd(zoomState.initScale.value ?? 1)); // print(zoomFile.getZoomFileHeightOffsetEnd(zoomState.initScale.value ?? 1));
if (dy < imageHeightOffsetStart || dy > zoomFile.getZoomFileHeightOffsetEnd(zoomState.initScale.value ?? 1)) return; // if (dy < imageHeightOffsetStart || dy > zoomFile.getZoomFileHeightOffsetEnd(zoomState.initScale.value ?? 1)) return; //
var theScale = zoomState.initScale.value ?? 1; var theScale = zoomState.initScale.value ?? 1;
@ -453,9 +453,19 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
// - imageHeightOffsetStart // - imageHeightOffsetStart
// if (theScale == 1) { // if (theScale == 1) {
// } // }
// (dy / theScale) - (max(0, imageHeightOffsetStart) / theScale) + ((sateData.zoomOffset?.dy.abs() ?? 0) / theScale),
var zoomWtdthSpaceVal = zoomFile.getZoomFileOffsetStartWidth(zoomState.initScale.value ?? 1);
localPosition = Offset( localPosition = Offset(
(localPosition.dx + (sateData.zoomOffset?.dx.abs() ?? 0)) / theScale, (localPosition.dx -
(dy / theScale) - (max(0, imageHeightOffsetStart) / theScale) + ((sateData.zoomOffset?.dy.abs() ?? 0) / theScale), zoomFile.getZoomFileOffsetStartWidth(zoomState.initScale.value ?? 1) +
((zoomWtdthSpaceVal <= 0.1) ? (sateData.zoomOffset?.dx.abs() ?? 0) : 0)) /
theScale,
(dy -
max(0, imageHeightOffsetStart) +
((zoomFile.imageHeightOffsetStart == null || zoomFile.imageHeightOffsetStart! <= 0.1) ? (sateData.zoomOffset?.dy.abs() ?? 0) : 0)) /
theScale,
); );
print("最终位置 $localPosition"); print("最终位置 $localPosition");

View File

@ -94,7 +94,8 @@ class ZoomLogic extends GetxController {
void onPanUpPosition(Offset val) async { void onPanUpPosition(Offset val) async {
// //
var state = Get.find<HomeworkReviewLogic>().state; var state = Get.find<HomeworkReviewLogic>().state;
if (state.zoomOffset?.dy.toStringAsFixed(2) != val.dy.toStringAsFixed(2) || state.zoomOffset?.dx.toStringAsFixed(2) != val.dx.toStringAsFixed(2)) { if (state.zoomOffset?.dy.toStringAsFixed(2) != val.dy.toStringAsFixed(2) ||
state.zoomOffset?.dx.toStringAsFixed(2) != val.dx.toStringAsFixed(2)) {
// print('**************** 正在移动位置 YYY:${val.dy}'); // print('**************** 正在移动位置 YYY:${val.dy}');
// print('**************** 正在移动位置 XXX:${val.dx}'); // print('**************** 正在移动位置 XXX:${val.dx}');
state.zoomOffset = val; state.zoomOffset = val;
@ -190,6 +191,14 @@ class ZoomFileModel extends Object {
return (viewHeight - (actualHeight! * zoom)) / 2; return (viewHeight - (actualHeight! * zoom)) / 2;
} }
///
/// zoom
double getZoomFileOffsetStartWidth(double zoom) {
if (zoom >= 1 || actualWidth == null) return 0;
return (viewWidth - (actualWidth! * zoom)) / 2;
}
/// ///
/// zoom /// zoom
double getZoomFileHeightOffsetEnd(double zoom) { double getZoomFileHeightOffsetEnd(double zoom) {
@ -197,7 +206,6 @@ class ZoomFileModel extends Object {
var topSpaceDimensions = getZoomFileOffsetStart(zoom); var topSpaceDimensions = getZoomFileOffsetStart(zoom);
return topSpaceDimensions + (actualHeight! * zoom); return topSpaceDimensions + (actualHeight! * zoom);
} }
} }
// //

View File

@ -5,7 +5,6 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import app_installer
import app_settings import app_settings
import auto_updater_macos import auto_updater_macos
import connectivity_plus import connectivity_plus
@ -16,7 +15,6 @@ import sqflite
import url_launcher_macos import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppInstallerPlugin.register(with: registry.registrar(forPlugin: "AppInstallerPlugin"))
AppSettingsPlugin.register(with: registry.registrar(forPlugin: "AppSettingsPlugin")) AppSettingsPlugin.register(with: registry.registrar(forPlugin: "AppSettingsPlugin"))
AutoUpdaterMacosPlugin.register(with: registry.registrar(forPlugin: "AutoUpdaterMacosPlugin")) AutoUpdaterMacosPlugin.register(with: registry.registrar(forPlugin: "AutoUpdaterMacosPlugin"))
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))