保存仿制图章修复与前轮发布诊断,待正式验收

这个提交包含在:
mac 于 2026-11-14 22:54:31 +08:00 提交
1 父节点 5a10408557
当前提交 ca9936ee3c
25 个文件已更改
+1354 -58

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

+22 -1
查看文件
@@ -161,6 +161,14 @@
[NSColor.blackColor setStroke];mark.lineWidth=3.5*_uiScale;[mark stroke];
[NSColor.systemCyanColor setStroke];mark.lineWidth=1.5*_uiScale;[mark stroke];
}
- (NSRect)stampActionRect:(NSInteger)index{return NSOffsetRect([self stampControlRect:index],0,-30*_uiScale);}
- (void)drawStampReference {
NSData *data=_mask[@"referenceShape"];if(data.length!=sizeof(DYMaskParameters))return;
DYMaskParameters p;[data getBytes:&p length:sizeof(p)];NSBezierPath *path=[NSBezierPath bezierPath];
const float xy[][2]={{-.5,-.5},{.5,-.5},{.5,.5},{-.5,.5}};
for(int i=0;i<4;i++){NSPoint q=[self canvasStampSource:NSMakePoint(p.centerX+xy[i][0]*p.width,p.centerY+xy[i][1]*p.height)];if(i)[path lineToPoint:q];else[path moveToPoint:q];}
[path closePath];path.lineWidth=3*_uiScale;[NSColor.blackColor setStroke];[path stroke];CGFloat dash[]={5*_uiScale,3*_uiScale};[path setLineDash:dash count:2 phase:0];path.lineWidth=1.5*_uiScale;[NSColor.systemGreenColor setStroke];[path stroke];
}
- (void)drawStampControls{
NSArray *source=_mask[@"stampSource"];
if(_viewerControls.stampArmed){
@@ -181,9 +189,17 @@
[outline closePath];outline.lineWidth=2*_uiScale;[NSColor.systemCyanColor setStroke];[outline stroke];
}
}else if(source.count==4){
[self drawStampReference];
[self drawStampSource:NSMakePoint([source[0]doubleValue],[source[1]doubleValue])];
BOOL tracking=[_mask[@"tracking"]boolValue];
NSArray *titles=tracking?@[@"停止跟踪"]:@[@"向后跟踪",@"双向跟踪",@"向前跟踪"];
NSString *status=_mask[@"status"];
if(status.length){
NSRect box=NSMakeRect(NSMinX(_imageRect)+8*_uiScale,NSMinY(_imageRect)+10*_uiScale,MAX(1,MIN(NSWidth(_imageRect)-16*_uiScale,680*_uiScale)),64*_uiScale);
DYDrawSoftControl(box,4,NO,NO,NO);NSMutableParagraphStyle *style=[[[NSMutableParagraphStyle alloc]init]autorelease];style.lineBreakMode=NSLineBreakByWordWrapping;
[status drawInRect:NSInsetRect(box,7*_uiScale,5*_uiScale) withAttributes:@{NSForegroundColorAttributeName:[_mask[@"trackingStopped"]boolValue]?NSColor.systemOrangeColor:NSColor.whiteColor,NSFontAttributeName:[NSFont systemFontOfSize:11*_uiScale],NSParagraphStyleAttributeName:style}];
}
if(!tracking){NSArray *actions=@[[_mask[@"referenceDrawing"]boolValue]?@"取消参考选择":@"选择跟踪参考",@"手工关键帧",@"最后可信帧"];for(NSInteger i=0;i<3;i++){NSRect cell=[self stampActionRect:i];DYDrawSoftControl(cell,4,NO,NO,NO);[actions[i]drawInRect:NSInsetRect(cell,4,4) withAttributes:@{NSForegroundColorAttributeName:i==2&&![_mask[@"canReturn"]boolValue]?NSColor.grayColor:NSColor.whiteColor,NSFontAttributeName:[NSFont systemFontOfSize:MAX(8.,NSHeight(cell)*.45)]}];}}
NSArray *titles=tracking?@[@"停止跟踪"]:[_mask[@"referenceDrawing"]boolValue]?@[]:@[@"向后跟踪",@"双向跟踪",@"向前跟踪"];
for(NSUInteger i=0;i<titles.count;i++){
NSRect cell=[self stampControlRect:i];DYDrawSoftControl(cell,4,NO,NO,NO);
[titles[i] drawInRect:NSInsetRect(cell,6,4) withAttributes:@{NSForegroundColorAttributeName:NSColor.whiteColor,NSFontAttributeName:[NSFont systemFontOfSize:MAX(8.,NSHeight(cell)*.48)]}];
@@ -240,6 +256,8 @@
NSArray *source=_mask[@"stampSource"];
if(source.count==4){
BOOL tracking=[_mask[@"tracking"]boolValue];
if(!tracking)for(NSInteger i=0;i<3;i++)if(NSPointInRect(point,[self stampActionRect:i]))return 10018+i;
if(!tracking&&[_mask[@"referenceDrawing"]boolValue])return NSPointInRect(point,_imageRect)?DYCloneReferencePart:0;
NSInteger count=tracking?1:3;
for(NSInteger i=0;i<count;i++)if(NSPointInRect(point,[self stampControlRect:i]))return 10011+i;
NSPoint cross=[self canvasStampSource:NSMakePoint([source[0]doubleValue],[source[1]doubleValue])];
@@ -262,6 +280,9 @@
if(type==NSEventTypeKeyDown&&key==27&&_viewerControls.stampArmed){
_viewerControls.stampArmed=NO;[self clearStampCreation];return YES;
}
if(type==NSEventTypeLeftMouseDown&&part>=10018&&part<=10020){
[plugin cloneStampCommand:@[@"reference",@"manual",@"return"][part-10018] mask:_mask[@"id"] atTime:time];return YES;
}
if(type==NSEventTypeLeftMouseDown&&part>=10011&&part<=10013){
NSInteger direction=[_mask[@"tracking"]boolValue]?9:part-10012;
[plugin trackCloneStamp:_mask[@"id"] direction:direction];return YES;