Skip to content

Commit

Permalink
♻️ Automatically setting bytes per row when creating context
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkulman committed Jan 22, 2021
1 parent e9c7d2c commit cc61193
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/ChangeMenuBarColor/Extensions/ImageFunctions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ func combineImages(baseImage: NSImage, addedImage: NSImage) -> NSImage? {
}

func createContext(width: CGFloat, height: CGFloat) -> CGContext? {
return CGContext(data: nil, width: Int(width), height: Int(height), bitsPerComponent: 8, bytesPerRow: 4 * Int(width), space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: CGImageAlphaInfo.premultipliedFirst.rawValue)
return CGContext(data: nil, width: Int(width), height: Int(height), bitsPerComponent: 8, bytesPerRow: 0, space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: CGImageAlphaInfo.premultipliedFirst.rawValue)
}

0 comments on commit cc61193

Please sign in to comment.