From dff9134be7bb77a36e7601bc393710ba3f56925f Mon Sep 17 00:00:00 2001 From: mac Date: Thu, 5 Nov 2026 22:12:43 +0800 Subject: [PATCH] Keep the clone identity through the host test document replacement --- 大鱼调色/Plugin/DYToolCanvasDiagnostics.inc.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/大鱼调色/Plugin/DYToolCanvasDiagnostics.inc.h b/大鱼调色/Plugin/DYToolCanvasDiagnostics.inc.h index ec1b378..dba3486 100644 --- a/大鱼调色/Plugin/DYToolCanvasDiagnostics.inc.h +++ b/大鱼调色/Plugin/DYToolCanvasDiagnostics.inc.h @@ -117,8 +117,9 @@ DYMaskParameters target=DYMaskAtTime(stamp,kCMTimeZero); run.record(@"native-osc-creates-one-stamp-and-one-undo-from-source-click-and-drag",source.count==4&&fabs([source[0]doubleValue]-.25)<1e-6&&fabs([source[1]doubleValue]-.25)<1e-6&&fabs(target.centerX-.65)<1e-6&&fabs(target.centerY-.5)<1e-6&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1); [osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero]; + NSString *stampID=[[stamp[@"id"]copy]autorelease]; NSMutableDictionary *tracked=DYMutablePlist(DYReadTools(host,kCMTimeZero).document); - NSMutableDictionary *trackedStamp=(id)DYSharedMaskWithID(tracked,stamp[@"id"]); + NSMutableDictionary *trackedStamp=(id)DYSharedMaskWithID(tracked,stampID); DYMaskParameters moved=target;moved.centerX+=.05f; NSArray *keys=@[DYMaskKey(kCMTimeZero,target,NO,1),DYMaskKey(CMTimeMake(1,25),moved,NO,1)]; trackedStamp[@"keys"]=keys;DYWriteTools(host,tracked,kCMTimeZero); @@ -129,16 +130,16 @@ [osc mouseDraggedAtPositionX:236 positionY:259.75 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero]; NSArray *preview=[plugin toolCanvasMaskAtTime:kCMTimeZero][@"stampSource"]; up(236,259.75,part);drain(); - NSDictionary *edited=DYSharedMaskWithID(DYReadTools(host,kCMTimeZero).document,stamp[@"id"]); + NSDictionary *edited=DYSharedMaskWithID(DYReadTools(host,kCMTimeZero).document,stampID); NSArray *relocated=edited[@"stampSource"]; - run.record(@"native-osc-drag-moves-only-the-stamp-source-and-keeps-tracking-keys",part==7&&fabs([relocated[0]doubleValue]-.35)<1e-6&&fabs([relocated[1]doubleValue]-.35)<1e-6&&[relocated isEqual:preview]&&[edited[@"parameters"]isEqual:trackedStamp[@"parameters"]]&&[edited[@"keys"]isEqual:keys]&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1); + run.record(@"native-osc-drag-moves-only-the-stamp-source-and-keeps-tracking-keys",part==7&&fabs([relocated[0]doubleValue]-.35)<1e-6&&fabs([relocated[1]doubleValue]-.35)<1e-6&&[relocated isEqual:preview]&&[edited[@"parameters"]isEqual:trackedStamp[@"parameters"]]&&[edited[@"keys"]isEqual:keys]&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1,@{@"part":@(part),@"source":relocated?:@[],@"keys":@([edited[@"keys"]count]),@"undoGroups":@(base->_undoStarts-undo)}); [osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero]; part=down(236,259.75); [osc mouseDraggedAtPositionX:270 positionY:240 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero]; BOOL handled=NO; [osc keyDownAtPositionX:270 positionY:240 keyPressed:27 modifiers:0 forceUpdate:&update didHandle:&handled atTime:kCMTimeZero]; drain(); - run.record(@"native-osc-escape-cancels-the-stamp-source-drag-without-another-undo",handled&&[DYSharedMaskWithID(DYReadTools(host,kCMTimeZero).document,stamp[@"id"])[@"stampSource"]isEqual:relocated]&&base->_undoStarts==undo+1); + run.record(@"native-osc-escape-cancels-the-stamp-source-drag-without-another-undo",handled&&[DYSharedMaskWithID(DYReadTools(host,kCMTimeZero).document,stampID)[@"stampSource"]isEqual:relocated]&&base->_undoStarts==undo+1); click(251,104);drain(); // top-down viewport y=30...345, forward button is x=212...290. run.record(@"native-osc-stamp-forward-action-starts-the-existing-host-tracker",host->_forwardStarts==1&&host->_backwardStarts==0); [plugin cleanupAnalysis:nil];drain();[(id)osc release];[(id)plugin release];