Skip to content

Commit

Permalink
Fix border bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LEOYoon-Tsaw committed Jun 5, 2022
1 parent 5bc46eb commit f1fb376
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SquirrelPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,6 @@ - (void)drawRect:(NSRect)dirtyRect {
}
CAShapeLayer *panelLayer = shapeFromPath(backPath);
panelLayer.fillColor = theme.backgroundColor.CGColor;
panelLayer.lineWidth = theme.borderWidth;
panelLayer.strokeColor = theme.borderColor.CGColor;
CAShapeLayer *panelLayerMask = shapeFromPath(backgroundPath);
panelLayer.mask = panelLayerMask;
[self.layer addSublayer: panelLayer];
Expand All @@ -867,6 +865,13 @@ - (void)drawRect:(NSRect)dirtyRect {
layer.mask = mask;
[panelLayer addSublayer: layer];
}
if (theme.borderWidth > 0 && theme.borderColor) {
CAShapeLayer *borderLayer = shapeFromPath(backgroundPath);
borderLayer.lineWidth = theme.borderWidth * 2;
borderLayer.strokeColor = theme.borderColor.CGColor;
borderLayer.fillColor = NULL;
[panelLayer addSublayer: borderLayer];
}
if (theme.highlightedPreeditColor && !CGPathIsEmpty(highlightedPreeditPath)) {
CAShapeLayer *layer = shapeFromPath(highlightedPreeditPath);
layer.fillColor = theme.highlightedPreeditColor.CGColor;
Expand Down

0 comments on commit f1fb376

Please sign in to comment.