mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
PixelPaint: Move title and path from Image to ImageEditor
As noted in the latest hacking video, it doesn't seem to make much sense to store the title and path in the image itself. These fields have now been moved to the actual ImageEditor itself. This allows some nice simplicfications, including getting rid of the `image_did_change_title` hook of ImageClient (which was just a way to report back to the editor that the title had changed).
This commit is contained in:
committed by
Andreas Kling
parent
0b43a92eed
commit
2440d2c2fe
Notes:
sideshowbarker
2024-07-17 21:37:42 +09:00
Author: https://github.com/mustafaquraish Commit: https://github.com/SerenityOS/serenity/commit/2440d2c2fe9 Pull-request: https://github.com/SerenityOS/serenity/pull/11632
@@ -35,7 +35,6 @@ ErrorOr<void> ProjectLoader::try_load_from_fd_and_close(int fd, StringView path)
|
||||
auto bitmap = TRY(Image::try_decode_bitmap(mapped_file->bytes()));
|
||||
auto image = TRY(Image::try_create_from_bitmap(move(bitmap)));
|
||||
|
||||
image->set_path(path);
|
||||
m_image = image;
|
||||
return {};
|
||||
}
|
||||
@@ -44,8 +43,6 @@ ErrorOr<void> ProjectLoader::try_load_from_fd_and_close(int fd, StringView path)
|
||||
auto& json = json_or_error.value().as_object();
|
||||
auto image = TRY(Image::try_create_from_pixel_paint_json(json));
|
||||
|
||||
image->set_path(path);
|
||||
|
||||
if (json.has("guides"))
|
||||
m_json_metadata = json.get("guides").as_array();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user