feat: finalize compact canvas shared-mask drawing and workspace synchronization
这个提交包含在:
1 父节点
ca352248c1
当前提交
385fb47f14
19 个文件已更改
+259
-65
没有与搜索条件相匹配的文件
@@ -26,9 +26,36 @@
|
||||
[osc hitTestOSCAtMousePositionX:450 mousePositionY:200 activePart:&part atTime:kCMTimeZero];BOOL insideViewer=part>=20000;[osc mouseDraggedAtPositionX:450 positionY:200 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];[osc mouseUpAtPositionX:450 positionY:200 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];drain();
|
||||
DYMaskParameters p=DYMaskAtTime(DYReadTools(base,kCMTimeZero).document[@"baseMasks"][@"hsl"][0],kCMTimeZero);
|
||||
run.record(@"native-osc-mask-gesture-keeps-capture-when-crossing-the-open-viewer-panel",insideViewer&&fabs(p.centerX-(.5+190./560))<1e-5&&fabs(p.centerY-(.5+12.5/315))<1e-5&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
BOOL toolbarBounded=YES;for(NSRect view:{NSMakeRect(400,310,480,100),NSMakeRect(0,0,120,80),NSMakeRect(-100,-50,400,300)}){
|
||||
[(id)osc setValue:[NSValue valueWithRect:view]forKey:@"imageRect"];[(id)osc setValue:@2 forKey:@"uiScale"];NSRect visible=NSIntersectionRect(view,NSMakeRect(0,0,640,400));
|
||||
for(NSInteger i=0;i<9;i++)toolbarBounded&=NSContainsRect(visible,[(id)osc toolbarRectForItem:i]);}
|
||||
run.record(@"native-osc-mask-toolbar-stays-inside-small-letterboxed-image",toolbarBounded);
|
||||
BOOL oldToolbarRemoved=YES;for(NSInteger i=0;i<9;i++)oldToolbarRemoved&=NSIsEmptyRect([(id)osc toolbarRectForItem:i]);
|
||||
run.record(@"native-osc-removes-all-nine-background-mask-toolbar-buttons",oldToolbarRemoved);
|
||||
[(id)osc setValue:@{@"drawing":@YES}forKey:@"mask"];BOOL penActionsBounded=YES;
|
||||
for(NSRect view:{NSMakeRect(400,310,480,100),NSMakeRect(0,0,120,80),NSMakeRect(-100,-50,400,300)}){
|
||||
[(id)osc setValue:[NSValue valueWithRect:view]forKey:@"imageRect"];[(id)osc setValue:@2 forKey:@"uiScale"];NSRect visible=NSIntersectionRect(view,NSMakeRect(0,0,640,400));
|
||||
for(NSInteger i=9;i<=10;i++)penActionsBounded&=NSContainsRect(visible,[(id)osc toolbarRectForItem:i]);}
|
||||
run.record(@"native-osc-keeps-only-two-pen-actions-bounded-at-bottom",penActionsBounded);
|
||||
[osc release];[plugin release];drain();
|
||||
}
|
||||
{
|
||||
// Rectangle and ellipse creation use a frozen author object and a live local
|
||||
// draft. The one saved geometry is shared by every assigned module.
|
||||
DYDiagnosticManager *base=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(base,&error);DYToolCanvasProbe *host=[[[DYToolCanvasProbe alloc]init]autorelease];host->_base=base;host->_time=kCMTimeZero;
|
||||
NSMutableDictionary *doc=DYMutablePlist(DYReadTools(base,kCMTimeZero).document);NSDictionary *mask=DYAddSharedMask(doc,DYMaskRectangle);NSString *maskID=[[mask[@"id"]copy]autorelease];DYSetSharedMaskAssigned(doc,maskID,@"base:hsl",YES);DYSetSharedMaskAssigned(doc,maskID,@"base:spider",YES);DYWriteTools(base,doc,kCMTimeZero);
|
||||
id<DYToolCanvasHostProbe>plugin=(id)[[NSClassFromString(@"DYPlugIn")alloc]initWithAPIManager:host];[plugin scheduleToolCanvasRegistration];NSData *state=nil;[plugin pluginState:&state atTime:kCMTimeZero quality:(FxQuality)0 error:&error];
|
||||
auto drain=[](){double end=NSProcessInfo.processInfo.systemUptime+.07;while(NSProcessInfo.processInfo.systemUptime<end)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.002]];};drain();
|
||||
auto selectShape=[&](){[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolCanvasSelection" object:host userInfo:@{@"node":@"shared",@"mask":maskID,@"document":DYReadTools(base,kCMTimeZero).document,@"drawShape":@YES}];};selectShape();
|
||||
id<FxOnScreenControl_v4>osc=(id)[[NSClassFromString(@"DYToolOSC")alloc]initWithAPIManager:host];DYDiagnosticTile *overlay=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:640 height:400]autorelease];[osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero];NSInteger part=0;BOOL update=NO,handled=NO;
|
||||
[osc hitTestOSCAtMousePositionX:152 mousePositionY:307 activePart:&part atTime:kCMTimeZero];NSDictionary *snapshot=[plugin toolCanvasMaskAtTime:kCMTimeZero];run.record(@"native-osc-new-shape-can-start-anywhere-and-hides-default-box",part==1&&[snapshot[@"drawShape"]boolValue]&&![snapshot[@"shapeStarted"]boolValue]&&[[(id)osc valueForKey:@"handles"]count]==0);
|
||||
NSDictionary *before=[[DYReadTools(base,kCMTimeZero).document copy]autorelease];int undo=base->_undoStarts;
|
||||
[osc mouseDownAtPositionX:152 positionY:307 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];[osc mouseDraggedAtPositionX:432 positionY:181 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];snapshot=[plugin toolCanvasMaskAtTime:kCMTimeZero];DYMaskParameters p;[snapshot[@"parameters"]getBytes:&p length:sizeof(p)];
|
||||
run.record(@"native-osc-shape-drag-updates-local-bbox-without-author-or-undo-write",[snapshot[@"shapeStarted"]boolValue]&&fabs(p.centerX-.45)<1e-5&&fabs(p.centerY-.4)<1e-5&&fabs(p.width-.5)<1e-5&&fabs(p.height-.4)<1e-5&&[before isEqual:DYReadTools(base,kCMTimeZero).document]&&base->_undoStarts==undo);
|
||||
[osc mouseUpAtPositionX:488 positionY:149.5 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];drain();NSDictionary *saved=DYReadTools(base,kCMTimeZero).document;NSDictionary *hsl=DYMasksForTool(saved,@"base:hsl").firstObject,*spider=DYMasksForTool(saved,@"base:spider").firstObject;p=DYMaskAtTime(hsl,kCMTimeZero);
|
||||
run.record(@"native-osc-shape-release-commits-final-bbox-once-to-all-shared-modules",hsl==spider&&fabs(p.centerX-.5)<1e-5&&fabs(p.centerY-.45)<1e-5&&fabs(p.width-.6)<1e-5&&fabs(p.height-.5)<1e-5&&p.kind==DYMaskRectangle&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1&&![[plugin toolCanvasMaskAtTime:kCMTimeZero][@"drawShape"]boolValue]);
|
||||
before=[[saved copy]autorelease];undo=base->_undoStarts;selectShape();[osc mouseDownAtPositionX:180 positionY:280 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];[osc mouseDraggedAtPositionX:400 positionY:160 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];[osc keyDownAtPositionX:400 positionY:160 keyPressed:27 modifiers:0 forceUpdate:&update didHandle:&handled atTime:kCMTimeZero];drain();
|
||||
run.record(@"native-osc-shape-escape-keeps-author-and-all-shared-bindings",handled&&[before isEqual:DYReadTools(base,kCMTimeZero).document]&&base->_undoStarts==undo&&![[plugin toolCanvasMaskAtTime:kCMTimeZero][@"drawShape"]boolValue]);
|
||||
selectShape();[osc mouseDownAtPositionX:180 positionY:280 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];[osc mouseUpAtPositionX:180 positionY:280 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];drain();run.record(@"native-osc-shape-click-without-area-does-not-write-or-create-undo",[before isEqual:DYReadTools(base,kCMTimeZero).document]&&base->_undoStarts==undo);
|
||||
selectShape();[osc mouseDownAtPositionX:180 positionY:280 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];[osc mouseDraggedAtPositionX:400 positionY:160 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];host->_time=CMTimeMake(1,24);[plugin toolCanvasMaskAtTime:host->_time];[osc mouseUpAtPositionX:400 positionY:160 activePart:1 modifiers:0 forceUpdate:&update atTime:host->_time];drain();run.record(@"native-osc-shape-playhead-change-cancels-before-write",[before isEqual:DYReadTools(base,kCMTimeZero).document]&&base->_undoStarts==undo&&![[plugin toolCanvasMaskAtTime:host->_time][@"drawShape"]boolValue]);host->_time=kCMTimeZero;
|
||||
selectShape();[osc mouseDownAtPositionX:180 positionY:280 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];[osc mouseUpAtPositionX:400 positionY:160 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];host->_time=CMTimeMake(1,24);drain();run.record(@"native-osc-queued-shape-commit-rechecks-host-playhead",[before isEqual:DYReadTools(base,kCMTimeZero).document]&&base->_undoStarts==undo);host->_time=kCMTimeZero;
|
||||
doc=DYMutablePlist(DYReadTools(base,kCMTimeZero).document);NSMutableDictionary *ellipse=(id)DYSharedMaskWithID(doc,maskID);p=DYMaskAtTime(ellipse,kCMTimeZero);p.kind=DYMaskEllipse;ellipse[@"parameters"]=[NSData dataWithBytes:&p length:sizeof(p)];DYWriteTools(base,doc,kCMTimeZero);selectShape();undo=base->_undoStarts;
|
||||
[osc mouseDownAtPositionX:488 positionY:149.5 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];[osc mouseUpAtPositionX:208 positionY:275.5 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];drain();p=DYMaskAtTime(DYSharedMaskWithID(DYReadTools(base,kCMTimeZero).document,maskID),kCMTimeZero);run.record(@"native-osc-ellipse-draws-reverse-direction-with-positive-shared-extents",p.kind==DYMaskEllipse&&fabs(p.centerX-.55)<1e-5&&fabs(p.centerY-.5)<1e-5&&fabs(p.width-.5)<1e-5&&fabs(p.height-.4)<1e-5&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
[osc release];[plugin release];drain();
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户