Make the clone source crosshair draggable without changing target tracks

这个提交包含在:
mac 于 2026-11-05 22:09:33 +08:00 提交
1 父节点 4fb008e100
当前提交 1f1b7917e7
6 个文件已更改
+61 -15

没有与搜索条件相匹配的文件

@@ -117,7 +117,29 @@
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];
click(251,104);drain(); // first draw has top-down viewport y=30...345, forward button is x=212...290.
NSMutableDictionary *tracked=DYMutablePlist(DYReadTools(host,kCMTimeZero).document);
NSMutableDictionary *trackedStamp=(id)DYSharedMaskWithID(tracked,stamp[@"id"]);
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);
[plugin pluginState:&state atTime:kCMTimeZero quality:(FxQuality)0 error:&error];
[osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero];
undo=base->_undoStarts;
part=down(180,291.25);
[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"]);
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);
[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);
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];
}