1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 07:34:57 +00:00
serenity/Userland/Libraries/LibWeb/Painting/BordersData.h
Aliaksandr Kalenik 70353b79af LibWeb: Change paint_all_borders() to accept only device pixel values
By consistently accepting only device pixel values instead of a mix of
CSSPixels and DevicePixels values, we can simplify the implementation
of paint_border() and paint_all_borders().
2023-11-20 14:59:47 +01:00

40 lines
901 B
C++

/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGfx/Color.h>
#include <LibWeb/CSS/ComputedValues.h>
#include <LibWeb/CSS/Enums.h>
#include <LibWeb/PixelUnits.h>
namespace Web::Painting {
struct BorderDataDevicePixels {
public:
Color color { Color::Transparent };
CSS::LineStyle line_style { CSS::LineStyle::None };
DevicePixels width { 0 };
};
struct BordersDataDevicePixels {
BorderDataDevicePixels top;
BorderDataDevicePixels right;
BorderDataDevicePixels bottom;
BorderDataDevicePixels left;
};
struct BordersData {
CSS::BorderData top;
CSS::BorderData right;
CSS::BorderData bottom;
CSS::BorderData left;
BordersDataDevicePixels to_device_pixels(PaintContext const& context) const;
};
}