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

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

Loading…
Cancel
Save