Skip to content

Commit

Permalink
Shadow stroke
Browse files Browse the repository at this point in the history
  • Loading branch information
LEOYoon-Tsaw committed Feb 12, 2023
1 parent 59d936e commit 890b025
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Squirrel Designer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 27;
CURRENT_PROJECT_VERSION = 28;
DEVELOPMENT_TEAM = 28HU5A7B46;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "Squirrel Designer/Info.plist";
Expand All @@ -341,7 +341,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 27;
CURRENT_PROJECT_VERSION = 28;
DEVELOPMENT_TEAM = 28HU5A7B46;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "Squirrel Designer/Info.plist";
Expand Down
6 changes: 4 additions & 2 deletions Squirrel Designer/LayoutModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,9 @@ class SquirrelView: NSView {
let glyphRange = layoutManager.glyphRange(forCharacterRange: charRange, actualCharacterRange: nil)
let boundingRect = layoutManager.boundingRect(forGlyphRange: glyphRange, in: textContainer)
var firstLineRange = NSMakeRange(NSNotFound, 0)
let firstLineRect = layoutManager.lineFragmentUsedRect(forGlyphAt: glyphRange.location, effectiveRange: &firstLineRange)
let _ = layoutManager.lineFragmentUsedRect(forGlyphAt: glyphRange.location, effectiveRange: &firstLineRange)
var lastLineRange = NSMakeRange(NSNotFound, 0)
let lastLineRect = layoutManager.lineFragmentUsedRect(forGlyphAt: NSMaxRange(glyphRange)-1, effectiveRange: &lastLineRange)
let _ = layoutManager.lineFragmentUsedRect(forGlyphAt: NSMaxRange(glyphRange)-1, effectiveRange: &lastLineRange)

var leadingRect = NSZeroRect
var bodyRect = boundingRect
Expand Down Expand Up @@ -1057,6 +1057,8 @@ class SquirrelView: NSView {
outerPath?.addPath(path)
let shadowLayerMask = shapeFromPath(path: outerPath)
shadowLayer.mask = shadowLayerMask
layer.strokeColor = NSColor.black.withAlphaComponent(0.2).cgColor
layer.lineWidth = 0.5
layer.addSublayer(shadowLayer)
}
panelLayer.addSublayer(layer)
Expand Down

0 comments on commit 890b025

Please sign in to comment.