mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-09 22:42:22 +00:00
Don't resize images if same size
This commit is contained in:
parent
b6317d7324
commit
b93df71431
1 changed files with 2 additions and 1 deletions
|
@ -30,7 +30,8 @@ public struct LazyResizableImage<Content: View>: View {
|
||||||
content(state, proxy)
|
content(state, proxy)
|
||||||
}
|
}
|
||||||
.processors([resizeProcessor == nil ? .resize(size: proxy.size) : resizeProcessor!])
|
.processors([resizeProcessor == nil ? .resize(size: proxy.size) : resizeProcessor!])
|
||||||
.onChange(of: proxy.size, initial: true) { _, newValue in
|
.onChange(of: proxy.size, initial: true) { oldValue, newValue in
|
||||||
|
guard oldValue != newValue else { return }
|
||||||
debouncedTask?.cancel()
|
debouncedTask?.cancel()
|
||||||
debouncedTask = Task {
|
debouncedTask = Task {
|
||||||
do { try await Task.sleep(for: .milliseconds(200)) } catch { return }
|
do { try await Task.sleep(for: .milliseconds(200)) } catch { return }
|
||||||
|
|
Loading…
Reference in a new issue