1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:57:44 +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:
Andreas Kling 2021-09-15 01:06:57 +02:00
parent 8949b0def6
commit 63c4fcdc69
3 changed files with 82 additions and 0 deletions

View 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);
}