forked from aparoksha/adwaita-swift
Fix picture's content being cleared automatically
This commit is contained in:
parent
fa344522a2
commit
901e19c052
@ -18,8 +18,14 @@ extension Picture {
|
|||||||
return inspect { storage, updateProperties in
|
return inspect { storage, updateProperties in
|
||||||
if updateProperties {
|
if updateProperties {
|
||||||
let pointer = storage.opaquePointer
|
let pointer = storage.opaquePointer
|
||||||
guard let data, data != storage.fields[oldData] as? Data else {
|
guard let data else {
|
||||||
gtk_picture_set_paintable(pointer, gdk_paintable_new_empty(0, 0))
|
if storage.fields[oldData] != nil {
|
||||||
|
gtk_picture_set_paintable(pointer, gdk_paintable_new_empty(0, 0))
|
||||||
|
storage.fields[oldData] = nil
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
guard data != storage.fields[oldData] as? Data else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let bytes = data.withUnsafeBytes { ptr in
|
let bytes = data.withUnsafeBytes { ptr in
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user