mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-16 15:21:56 +00:00
LibWeb: Fix new ImageData(width, height)
when width != height
This commit is contained in:
parent
134c4b6335
commit
c08ba8ac4c
Notes:
sideshowbarker
2024-07-16 22:11:09 +09:00
Author: https://github.com/awesomekling
Commit: c08ba8ac4c
Pull-request: https://github.com/SerenityOS/serenity/pull/23969
Reviewed-by: https://github.com/kennethmyhra ✅
3 changed files with 7 additions and 1 deletions
|
@ -73,7 +73,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<ImageData>> ImageData::create(JS::Realm& re
|
|||
return WebIDL::IndexSizeError::create(realm, "Source height must be equal to the calculated height of the data."_fly_string);
|
||||
|
||||
// 7. Initialize this given sw, sh, settings set to settings, and source set to data.
|
||||
auto bitmap = TRY_OR_THROW_OOM(vm, Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, Gfx::IntSize(sw, sw), 1, sw * sizeof(u32), uint8_clamped_array_data.data().data()));
|
||||
auto bitmap = TRY_OR_THROW_OOM(vm, Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, Gfx::IntSize(sw, height), 1, sw * sizeof(u32), uint8_clamped_array_data.data().data()));
|
||||
|
||||
return realm.heap().allocate<ImageData>(realm, realm, bitmap, uint8_clamped_array_data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue