mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 13:27:34 +00:00
LibWeb: Add SVG::ViewBox to represent SVG view boxes
This also comes with a simple little parsing helper. :^)
This commit is contained in:
parent
8949b0def6
commit
63c4fcdc69
3 changed files with 82 additions and 0 deletions
23
Userland/Libraries/LibWeb/SVG/ViewBox.h
Normal file
23
Userland/Libraries/LibWeb/SVG/ViewBox.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
||||
struct ViewBox {
|
||||
float min_x { 0 };
|
||||
float min_y { 0 };
|
||||
float width { 0 };
|
||||
float height { 0 };
|
||||
};
|
||||
|
||||
Optional<ViewBox> try_parse_view_box(StringView);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue