Improve color continuity in the image editor.

pull/2/head
Matthew Chen 7 years ago
parent 93cb0e3a10
commit 3d96cd488e

@ -6,7 +6,7 @@ import UIKit
@objc
public protocol ImageEditorBrushViewControllerDelegate: class {
func brushDidComplete()
func brushDidComplete(currentColor: ImageEditorColor)
}
// MARK: -
@ -121,7 +121,7 @@ public class ImageEditorBrushViewController: OWSViewController {
}
private func completeAndDismiss() {
self.delegate?.brushDidComplete()
self.delegate?.brushDidComplete(currentColor: paletteView.selectedValue)
self.dismiss(animated: false) {
// Do nothing.

@ -24,7 +24,8 @@ public class ImageEditorView: UIView {
private let canvasView: ImageEditorCanvasView
// TODO: We could hang this on the model or make this static.
// TODO: We could hang this on the model or make this static
// if we wanted more color continuity.
private var currentColor = ImageEditorColor.defaultColor()
@objc
@ -444,7 +445,8 @@ public class ImageEditorView: UIView {
let cropTool = ImageEditorCropViewController(delegate: self, model: model, srcImage: srcImage, previewImage: previewImage)
self.delegate?.imageEditor(presentFullScreenView: cropTool,
isTransparent: false)
}}
}
}
// MARK: -
@ -498,6 +500,8 @@ extension ImageEditorView: ImageEditorTextViewControllerDelegate {
} else {
model.append(item: newItem)
}
self.currentColor = color
}
public func textEditDidCancel() {
@ -520,6 +524,7 @@ extension ImageEditorView: ImageEditorCropViewControllerDelegate {
// MARK: -
extension ImageEditorView: ImageEditorBrushViewControllerDelegate {
public func brushDidComplete() {
public func brushDidComplete(currentColor: ImageEditorColor) {
self.currentColor = currentColor
}
}

Loading…
Cancel
Save