1
Fork 0

Fix indentation and remove more debug logging

This commit is contained in:
Joshua Goins 2022-06-15 11:09:17 -04:00
parent eeba7bba02
commit 897df62a49

View file

@ -13,34 +13,34 @@ struct SilicaChunk {
// all supported Procreate blend modes
enum BlendMode : Int {
case Normal = 0,
Multiply = 1,
Screen = 2,
Add = 3,
Lighten = 4,
Exclusion = 5,
Difference = 6,
Subtract = 7,
LinearBurn = 8,
ColorDodge = 9,
ColorBurn = 10,
Overlay = 11,
HardLight = 12,
Color = 13,
Luminosity = 14,
Hue = 15,
Saturation = 16,
SoftLight = 17,
// what is this mysterious 18?
Darken = 19,
Multiply = 1,
Screen = 2,
Add = 3,
Lighten = 4,
Exclusion = 5,
Difference = 6,
Subtract = 7,
LinearBurn = 8,
ColorDodge = 9,
ColorBurn = 10,
Overlay = 11,
HardLight = 12,
Color = 13,
Luminosity = 14,
Hue = 15,
Saturation = 16,
SoftLight = 17,
// what is this mysterious 18?
Darken = 19,
// extended modes
HardMix = 20,
VividLight = 21,
LinearLight = 22,
PinLight = 23,
LighterColor = 24,
DarkerColor = 25,
Divide = 26
// extended modes
HardMix = 20,
VividLight = 21,
LinearLight = 22,
PinLight = 23,
LighterColor = 24,
DarkerColor = 25,
Divide = 26
}
struct SilicaLayerData {
@ -608,8 +608,6 @@ class Document: NSDocument {
let kernel = getBlendKernel(layer)
Swift.print(layer.name + " - " + kernel!.name)
for chunk in layer.data.chunks {
layerContext?.setAlpha(CGFloat(layer.data.opacity))
layerContext?.setBlendMode(.normal)
@ -737,7 +735,6 @@ class Document: NSDocument {
var clippedMaster: CGImage? = layerImage
for layer in clippingLayers {
// so we if we want to clip, we want to gather all of the clipping layers in order first...
let temporaryClippedMaster = blendLayer(layer, previousImage: &clippedMaster)
clippedMaster = context.createCGImage(temporaryClippedMaster, from: info.cgRect, format: .RGBA8, colorSpace: info.colorSpace)
@ -747,15 +744,15 @@ class Document: NSDocument {
layerContext?.setBlendMode(.sourceAtop)
layerContext?.draw(clippedMaster!, in: info.cgRect)
}
}
let layerImage = layerContext?.makeImage()
if layer.mask != nil && maskContext != nil {
let maskImage = (maskContext?.makeImage())!
let newImage = layerImage!.masking(maskImage)!
let maskImage = (maskContext?.makeImage())!
let newImage = layerImage!.masking(maskImage)!
previousImage = newImage
previousImage = newImage
} else {
previousImage = layerImage
}