Respond to CR.

pull/2/head
Matthew Chen 7 years ago
parent c31d469651
commit ddbef4e311

@ -29,6 +29,11 @@ public class ImageEditorCanvasView: UIView {
private let itemIdsToIgnore: [String]
// We want strokes to be rendered above the image and behind text.
private static let brushLayerZ: CGFloat = +1
// We want text to be rendered above the image and strokes.
private static let textLayerZ: CGFloat = +2
@objc
public required init(model: ImageEditorModel,
itemIdsToIgnore: [String] = []) {
@ -461,8 +466,7 @@ public class ImageEditorCanvasView: UIView {
shapeLayer.fillColor = nil
shapeLayer.lineCap = kCALineCapRound
shapeLayer.lineJoin = kCALineJoinRound
// We want strokes to be rendered above the image and behind text.
shapeLayer.zPosition = 1
shapeLayer.zPosition = brushLayerZ
return shapeLayer
}
@ -524,8 +528,7 @@ public class ImageEditorCanvasView: UIView {
let transform = CGAffineTransform.identity.scaledBy(x: item.scaling, y: item.scaling).rotated(by: item.rotationRadians)
layer.setAffineTransform(transform)
// We want text to be rendered above the image and strokes.
layer.zPosition = 2
layer.zPosition = textLayerZ
return layer
}

@ -180,7 +180,6 @@ public class ImageEditorTextViewController: OWSViewController, VAlignTextViewDel
})
configureTextView()
textView.addRedBorder()
self.view.layoutMargins = UIEdgeInsets(top: 16, left: 20, bottom: 16, right: 20)

Loading…
Cancel
Save