Skip to content

Commit

Permalink
feat: after clearing, the bitmap should be cleared, and the width and…
Browse files Browse the repository at this point in the history
… height should be reset to the initial values. (#937)
  • Loading branch information
rambo-panda authored Nov 11, 2024
1 parent 0d748a7 commit e2a86fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ impl Image {
let length = data.len();
if length <= 2 {
self.src = Some(data);
self.width = -1.0;
self.height = -1.0;
self.bitmap = None;

let onload = this.get_named_property_unchecked::<Unknown>("onload")?;
if onload.get_type()? == ValueType::Function {
let onload_func: Function<(), ()> = Function::from_unknown(onload)?;
Expand Down

0 comments on commit e2a86fe

Please sign in to comment.