fix: retain compact folded defaults after resetting all tools
这个提交包含在:
1 父节点
2711e0016e
当前提交
49d35cb49a
1 个文件已更改
+2
-2
@@ -855,7 +855,7 @@ static NSImage *DYWheelImage(void) {
|
||||
id<PROAPIAccessing> maskHost=_embedded?[(DYToolManager*)_manager host]:_manager;NSDictionary *tools=DYReadTools(maskHost,t).document;for(NSDictionary *card in _cards){
|
||||
NSString *type=card[@"section"][@"key"];BOOL visible=YES;
|
||||
if(!_embedded){DYInspectorToken *token=nil;[get getCustomParameterValue:&token fromParameter:DYInspectorParameterID atTime:t];visible=[@[@"primary",@"base",@"spider",@"hsl"]containsObject:type]||[token.folds[[@"visible:" stringByAppendingString:type]]boolValue];
|
||||
if(!visible){for(NSDictionary*d in DYBaseToolDescriptors(type)){double value=[d[@"default"]doubleValue];[get getFloatValue:&value fromParameter:[d[@"pid"]unsignedIntValue]atTime:t];if(std::isfinite(value)&&fabs(value-[d[@"default"]doubleValue])>1e-6){visible=YES;break;}}if([tools[@"baseMasks"][type]count])visible=YES;if([type isEqual:@"look"]&&DYReadAssets(_manager,t).paths.count)visible=YES;}
|
||||
if(!visible){for(NSDictionary*d in DYBaseToolDescriptors(type)){double value=[d[@"default"]doubleValue];[get getFloatValue:&value fromParameter:[d[@"pid"]unsignedIntValue]atTime:t];if(std::isfinite(value)&&fabs(value-[d[@"default"]doubleValue])>1e-6){visible=YES;break;}}if([tools[@"baseMasks"][type]count])visible=YES;if([type isEqual:@"look"])for(NSString *assetKey in DYReadAssets(_manager,t).paths)if([assetKey hasPrefix:@"look"])visible=YES;}
|
||||
}
|
||||
BOOL removed=!_embedded&&(DYBaseToolRemoved(tools,type)||!visible);groupingChanged|=[card[@"removed"]boolValue]!=removed;((NSMutableDictionary *)card)[@"removed"]=@(removed);
|
||||
[card[@"maskPanel"]refreshWithDocument:tools time:t];
|
||||
@@ -1024,7 +1024,7 @@ static NSImage *DYWheelImage(void) {
|
||||
NSError *failure=nil;if(!DYResetToolParameters(_manager,DYDescriptors(),t,&failure)){dispatch_async(dispatch_get_main_queue(),^{[self showError:failure.localizedDescription?:@"未能完整还原参数。"];});return;}
|
||||
DYAssetState *assets=[[[DYAssetState alloc] init] autorelease];assets.paths=@{};DYWriteAssets(_manager,assets,t);DYWriteTools(_manager,[[[DYToolDocument alloc]init]autorelease].document,t);
|
||||
[set setCustomParameterValue:[[[DYInspectorToken alloc]init]autorelease] toParameter:DYInspectorParameterID atTime:t];
|
||||
for(NSMutableDictionary *card in _cards)card[@"collapsed"]=@(![@[@"primary",@"spider",@"base"]containsObject:card[@"section"][@"key"]]);
|
||||
for(NSMutableDictionary *card in _cards)card[@"collapsed"]=@YES;
|
||||
} @finally {if(grouped)[undo endUndoGroup];[action endAction:self];}
|
||||
[self postChanged];
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户