Hide the current text item while the text item editor is open.
This commit is contained in:
parent
d15f5b581f
commit
65ee1dbd75
@ -27,9 +27,13 @@ public class ImageEditorCanvasView: UIView {
|
||||
|
||||
private let model: ImageEditorModel
|
||||
|
||||
private let itemIdsToIgnore: [String]
|
||||
|
||||
@objc
|
||||
public required init(model: ImageEditorModel) {
|
||||
public required init(model: ImageEditorModel,
|
||||
itemIdsToIgnore: [String] = []) {
|
||||
self.model = model
|
||||
self.itemIdsToIgnore = itemIdsToIgnore
|
||||
|
||||
super.init(frame: .zero)
|
||||
|
||||
@ -180,6 +184,11 @@ public class ImageEditorCanvasView: UIView {
|
||||
updateImageLayer()
|
||||
|
||||
for item in model.items() {
|
||||
guard !itemIdsToIgnore.contains(item.itemId) else {
|
||||
// Ignore this item.
|
||||
continue
|
||||
}
|
||||
|
||||
guard let layer = ImageEditorCanvasView.layerForItem(item: item,
|
||||
model: model,
|
||||
transform: transform,
|
||||
|
||||
@ -122,7 +122,8 @@ public class ImageEditorTextViewController: OWSViewController, VAlignTextViewDel
|
||||
self.model = model
|
||||
self.textItem = textItem
|
||||
self.maxTextWidthPoints = maxTextWidthPoints
|
||||
self.canvasView = ImageEditorCanvasView(model: model)
|
||||
self.canvasView = ImageEditorCanvasView(model: model,
|
||||
itemIdsToIgnore: [textItem.itemId])
|
||||
self.paletteView = ImageEditorPaletteView(currentColor: textItem.color)
|
||||
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user