Skip to content

Commit 9a00c75

Browse files
committed
Support redo in graffiti and mosaic tools.
1 parent 09137bb commit 9a00c75

13 files changed

+233
-84
lines changed

Example/Example/ViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ class ViewController: UIViewController {
225225
.fontChooserContainerView(FontChooserContainerView())
226226
// Custom filter
227227
// .filters = [.normal]
228+
.canRedo(true)
228229
}
229230

230231
@objc func pickImage() {
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
//
2+
// UIView+ZLImageEditor.swift
3+
// ZLImageEditor
4+
//
5+
// Created by long on 2022/8/30.
6+
//
7+
// Copyright (c) 2020 Long Zhang <495181165@qq.com>
8+
//
9+
// Permission is hereby granted, free of charge, to any person obtaining a copy
10+
// of this software and associated documentation files (the "Software"), to deal
11+
// in the Software without restriction, including without limitation the rights
12+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
// copies of the Software, and to permit persons to whom the Software is
14+
// furnished to do so, subject to the following conditions:
15+
//
16+
// The above copyright notice and this permission notice shall be included in
17+
// all copies or substantial portions of the Software.
18+
//
19+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
// THE SOFTWARE.
26+
27+
import UIKit
28+
29+
extension ZLImageEditorWrapper where Base: UIView {
30+
var top: CGFloat {
31+
base.frame.minY
32+
}
33+
34+
var bottom: CGFloat {
35+
base.frame.maxY
36+
}
37+
38+
var left: CGFloat {
39+
base.frame.minX
40+
}
41+
42+
var right: CGFloat {
43+
base.frame.maxX
44+
}
45+
46+
var width: CGFloat {
47+
base.frame.width
48+
}
49+
50+
var height: CGFloat {
51+
base.frame.height
52+
}
53+
}

0 commit comments

Comments
 (0)