增加模块整体强度与中文工具栏,分组简化一级面板(验证中)

这个提交包含在:
mac 于 2026-11-17 01:58:26 +08:00 提交
1 父节点 0388b79bd8
当前提交 a1a0779e12
17 个文件已更改
+191 -74

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

+3 -16
查看文件
@@ -105,17 +105,7 @@
- (void)drawLevelControls {
if(!_levelMode)return;
NSRect viewport=NSIntersectionRect(_imageRect,NSMakeRect(0,0,_canvasWidth,_height));
CGFloat scale=MIN(_uiScale,NSWidth(viewport)/420.);
NSRect prompt=NSMakeRect(NSMinX(viewport)+8*scale,NSMinY(viewport)+8*scale,400*scale,72*scale);
DYDrawSoftControl(prompt,4*scale,NO,NO,NO);
NSString *title=_levelFailure?:(_levelSaving?@"正在保存水平校正…":_levelPlaced?@"拖动端点修正 · 空白处重画 · Esc 收起":_levelHasFirst?@"选择参考线终点 · Esc 取消":@"点击两点或拖出参考线 · Esc 收起");
NSDictionary *attrs=@{NSForegroundColorAttributeName:NSColor.whiteColor,NSFontAttributeName:[NSFont systemFontOfSize:12*scale]};
[title drawInRect:NSMakeRect(NSMinX(prompt)+6*scale,NSMinY(prompt)+5*scale,388*scale,18*scale) withAttributes:attrs];
DYLevelTransform result(_levelAngle,_level.aspect);
NSString *numbers=[NSString stringWithFormat:@"FCP 旋转 %+.2f° 缩放 %.2f%%(增加 %.2f%%)",-_levelAngle*180/M_PI,result.zoom*100,(result.zoom-1)*100];
[numbers drawInRect:NSMakeRect(NSMinX(prompt)+6*scale,NSMinY(prompt)+27*scale,388*scale,18*scale) withAttributes:attrs];
NSString *hint=_viewerControls.levelMeasureOnly?@"仅测量:数值用于原始变换;已有缩放请乘以上述比例。":@"插件已应用;改用原始变换前,请切换「仅测量」。";
[hint drawInRect:NSMakeRect(NSMinX(prompt)+6*scale,NSMinY(prompt)+49*scale,388*scale,18*scale) withAttributes:@{NSForegroundColorAttributeName:NSColor.whiteColor,NSFontAttributeName:[NSFont systemFontOfSize:10*scale]}];
NSString *title=_levelFailure?:(_levelSaving?@"正在保存水平校正…":_levelPlaced?@"拖动端点修正;空白处重画;Esc 收起":_levelHasFirst?@"选择参考线终点;Esc 取消":@"点击两点或拖出参考线;Esc 收起");DYLevelTransform result(_levelAngle,_level.aspect);NSString *numbers=[NSString stringWithFormat:@"%@ · FCP旋转 %+.2f° · 缩放 %.2f%%%@",title,-_levelAngle*180/M_PI,result.zoom*100,_viewerControls.levelMeasureOnly?@" · 仅测量":@""];[_viewerControls.bridge publishScreenTool:@"level" message:numbers];
if(!_levelHasFirst&&!_levelPlaced)return;
NSPoint first=[self canvasDisplayPoint:_level.toOutput(_levelFirst)],last=[self canvasDisplayPoint:_level.toOutput(_levelLast)];
[NSGraphicsContext saveGraphicsState];NSRectClip(viewport);
@@ -173,10 +163,7 @@
- (void)drawStampControls{
NSArray *source=_mask[@"stampSource"];
if(_viewerControls.stampArmed){
NSRect cell=NSUnionRect([self stampControlRect:0],[self stampControlRect:3]);
DYDrawSoftControl(cell,4,NO,NO,NO);
NSString *prompt=_stampSaving?@"正在保存仿制图章…":_stampFailure?:(_stampHasSource?@"拖出要覆盖的椭圆 · Esc 取消":@"点击画面选择取样中心 · Esc 取消");
[prompt drawInRect:NSInsetRect(cell,6,4) withAttributes:@{NSForegroundColorAttributeName:NSColor.whiteColor,NSFontAttributeName:[NSFont systemFontOfSize:MAX(8.,NSHeight(cell)*.48)]}];
NSString *prompt=_stampSaving?@"正在保存仿制图章…":_stampFailure?:(_stampHasSource?@"拖出要覆盖的椭圆;Esc 取消":@"点击画面选择取样中心;Esc 取消");[_viewerControls.bridge publishScreenTool:@"cloneStamp" message:prompt];
if(_stampHasSource)[self drawStampSource:_stampSource];
if(_stampDragging||_stampSaving||_stampFailure){
NSRect target=[self stampTarget];
@@ -238,7 +225,7 @@
for(NSInteger item=9;item<=10;item++){NSString *title=item==9?@"✓ 完成":@"取消";NSRect cell=[self toolbarRectForItem:item];CGFloat size=cell.size.height*.48;[title drawInRect:NSInsetRect(cell,0,MAX(0.,(cell.size.height-size-3)/2))withAttributes:@{NSFontAttributeName:[NSFont systemFontOfSize:size weight:NSFontWeightMedium],NSForegroundColorAttributeName:NSColor.whiteColor,NSShadowAttributeName:shadow,NSParagraphStyleAttributeName:style}];}
}
}if(_levelMode)[self drawLevelControls];else [self drawStampControls];[_viewerControls draw];
if(_hslSampling){NSRect prompt=[self hslPickerRect];DYDrawSoftControl(prompt,4,NO,NO,NO);[@"HSL 吸管:点击画面取色 · Esc 取消" drawInRect:NSInsetRect(prompt,7*_uiScale,5*_uiScale) withAttributes:@{NSForegroundColorAttributeName:NSColor.whiteColor,NSFontAttributeName:[NSFont systemFontOfSize:11*_uiScale]}];}
if(_hslSampling)[_viewerControls.bridge publishScreenTool:@"hsl" message:@"HSL 吸管:点击画面取色;Esc 取消"];
[NSGraphicsContext restoreGraphicsState];CIImage *overlay=[CIImage imageWithCGImage:bitmap.CGImage options:@{kCIImageColorSpace:NSNull.null}];overlay=[overlay imageByApplyingTransform:CGAffineTransformMakeTranslation(NSMinX(region),texture.height-NSMaxY(region))];[_context render:overlay toMTLTexture:texture commandBuffer:commands bounds:CGRectMake(0,0,texture.width,texture.height) colorSpace:nil];
}[commands commit];[commands waitUntilCompleted];
}}}