Implement adaptive inspector and responsive canvas controls for 1.12.1

这个提交包含在:
mac 于 2026-11-05 17:01:00 +08:00 提交
1 父节点 91b66eb2d8
当前提交 585c83c8a1
21 个文件已更改
+316 -68

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

@@ -12,7 +12,7 @@
publish();int undo=base->_undoStarts;NSDictionary *initial=[[base->_values copy]autorelease];
NSMutableSet *types=[NSMutableSet set];NSInteger masks=0;CGFloat lastX=-1,y=-1;BOOL horizontal=YES;
for(NSDictionary *a in [controls valueForKey:@"areas"]){if([a[@"kind"]isEqual:@"mask"])masks++;if([a[@"kind"]isEqual:@"tool"]){NSRect r=[a[@"rect"]rectValue];if(lastX>=0)horizontal&=r.origin.x>lastX&&r.origin.y==y;lastX=r.origin.x;y=r.origin.y;[types addObject:a[@"toolType"]];}}
run.record(@"viewer-lower-left-rail-has-only-four-image-tools-and-three-persistent-mask-shapes",horizontal&&y>size.height*.9&&[types isEqual:[NSSet setWithArray:@[@"curve",@"lens",@"skin",@"look"]]]&&masks==3&&[[controls valueForKey:@"panels"]count]==0);
run.record(@"viewer-lower-right-rail-has-five-image-tools-and-three-persistent-mask-shapes",horizontal&&lastX>size.width*.8&&y>size.height*.9&&[types isEqual:[NSSet setWithArray:@[@"curve",@"lens",@"skin",@"look",@"whiteBalance"]]]&&masks==3&&[[controls valueForKey:@"panels"]count]==0);
NSDictionary *workspace=areaFor(controls,@"workspace",nil);NSRect workspaceRect=[workspace[@"rect"]rectValue];
run.record(@"viewer-control-panel-entry-is-labelled-and-anchored-at-bottom",[workspace[@"title"]isEqual:@"控制面板"]&&NSMidY(workspaceRect)>size.height*.9);
__block NSInteger workspaceRequests=0;__block NSString *requestedPage=nil;__block NSInteger requestedMask=-1;
@@ -23,16 +23,34 @@
BOOL maskRoutes=YES;for(NSDictionary *a in [[[controls valueForKey:@"areas"]copy]autorelease])if([a[@"kind"]isEqual:@"mask"]){click(a);drain();maskRoutes&=[requestedPage isEqual:@"masks"]&&requestedMask==[a[@"index"]integerValue];}
run.record(@"viewer-persistent-mask-entries-route-shapes-to-shared-workspace",maskRoutes&&base->_undoStarts==undo);
[NSNotificationCenter.defaultCenter removeObserver:observer];[requestedPage release];
__block NSInteger eyedropperRequests=0;__block CMTime eyedropperTime=kCMTimeInvalid;
id sampleObserver=[NSNotificationCenter.defaultCenter addObserverForName:@"DYViewerWhiteBalanceRequested" object:host queue:nil usingBlock:^(NSNotification *note){eyedropperRequests++;eyedropperTime=[note.userInfo[@"time"] CMTimeValue];}];
click(areaFor(controls,@"tool",@"whiteBalance"));drain();
run.record(@"viewer-white-balance-icon-routes-a-single-time-bound-pick",eyedropperRequests==1&&CMTimeCompare(eyedropperTime,host->_time)==0&&!panelFor(@"whiteBalance")&&[initial isEqual:base->_values]);
[NSNotificationCenter.defaultCenter removeObserver:sampleObserver];
run.record(@"viewer-distortion-entry-uses-pincushion-grid", [areaFor(controls,@"tool",@"lens")[@"symbol"]isEqual:@"pincushion-grid"]);
click(areaFor(controls,@"tool",@"skin"));drain();publish();
run.record(@"viewer-skin-entry-toggles-actual-protection-preview-without-parameter-card",value(@"skinVisualize")==1&&!panelFor(@"skin")&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
click(areaFor(controls,@"tool",@"skin"));drain();publish();run.record(@"viewer-skin-preview-toggle-restores-review-image",value(@"skinVisualize")==0&&!panelFor(@"skin"));
click(areaFor(controls,@"tool",@"curve"));id curve=panelFor(@"curve");
run.record(@"viewer-curve-is-graph-only-without-title-catalog-or-parameter-page",curve&&areaFor(curve,@"curvePlot",nil)&&!areaFor(curve,@"open",nil)&&!areaFor(curve,@"catalog",nil)&&!areaFor(curve,@"graphMode",nil)&&!areaFor(curve,@"slider",nil));
NSRect plot=[areaFor(curve,@"curvePlot",nil)[@"rect"]rectValue];NSPoint point=NSMakePoint(plot.origin.x+.43*plot.size.width,plot.origin.y+.18*plot.size.height);undo=base->_undoStarts;
NSRect plot=[areaFor(curve,@"curvePlot",nil)[@"rect"]rectValue],grip=[areaFor(curve,@"curveGrip",nil)[@"rect"]rectValue];
run.record(@"viewer-curve-opens-above-the-lower-right-controls",NSMidX(plot)>size.width*.8&&NSMaxY(plot)<NSMinY(workspaceRect)&&NSMaxY(plot)>size.height*.8&&!NSIsEmptyRect(grip));
NSPoint gripStart=NSMakePoint(NSMidX(grip),NSMidY(grip)),gripEnd=NSMakePoint(gripStart.x-70,gripStart.y-52);
undo=base->_undoStarts;[controls event:NSEventTypeLeftMouseDown point:gripStart atTime:host->_time];[controls event:NSEventTypeLeftMouseDragged point:gripEnd atTime:host->_time];[controls event:NSEventTypeLeftMouseUp point:gripEnd atTime:host->_time];drain();
NSRect shifted=[areaFor(curve,@"curvePlot",nil)[@"rect"]rectValue];
run.record(@"viewer-curve-grip-moves-both-axes-without-a-grade-or-undo",fabs(NSMinX(shifted)-NSMinX(plot)+70)<.1&&fabs(NSMinY(shifted)-NSMinY(plot)+52)<.1&&base->_undoStarts==undo);
plot=shifted;NSPoint point=NSMakePoint(plot.origin.x+.43*plot.size.width,plot.origin.y+.18*plot.size.height);undo=base->_undoStarts;
[controls event:NSEventTypeLeftMouseDown point:point atTime:host->_time];NSString *xKey=[[[curve valueForKey:@"captured"][@"xKey"]copy]autorelease],*yKey=[[[curve valueForKey:@"captured"][@"yKey"]copy]autorelease];drain();
[controls event:NSEventTypeLeftMouseDragged point:NSMakePoint(plot.origin.x+.54*plot.size.width,plot.origin.y+.23*plot.size.height)atTime:host->_time];drain();
run.record(@"viewer-curve-point-is-live-xy-not-a-scalar-only-control",xKey&&yKey&&fabs(value(xKey)-.54)<1e-5&&fabs(value(yKey)-23)<1e-4&&base->_undoStarts==undo+1&&base->_undoEnds==undo);
[controls event:NSEventTypeLeftMouseUp point:NSMakePoint(plot.origin.x+.61*plot.size.width,plot.origin.y+.3*plot.size.height)atTime:host->_time];drain();publish();
[controls event:NSEventTypeLeftMouseUp point:NSMakePoint(plot.origin.x+.61*plot.size.width,plot.origin.y+.3*plot.size.height)atTime:host->_time];
auto visibleCurveX=[&](NSString *key)->double{for(NSDictionary *p in [curve performSelector:@selector(curvePoints)])if([p[@"xKey"]isEqual:key])return [p[@"x"]doubleValue];return NAN;};
BOOL pendingStays=fabs(visibleCurveX(xKey)-.61)<1e-5;
drain();[controls prepareWithSize:size scale:1 atTime:host->_time];
run.record(@"viewer-curve-release-never-exposes-the-stale-plot-before-or-after-write",pendingStays&&fabs(visibleCurveX(xKey)-.61)<1e-5);
publish();
run.record(@"viewer-curve-final-release-commits-both-axes-with-one-undo",fabs(value(xKey)-.61)<1e-5&&fabs(value(yKey)-9)<1e-4&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
undo=base->_undoStarts;NSDictionary *deleteArea=areaFor(curve,@"deletePoint",nil);click(deleteArea);drain();publish();
run.record(@"viewer-curve-delete-deactivates-the-selected-slot",deleteArea&&value(xKey)==-1&&value(yKey)==0&&base->_undoStarts==undo+1);