mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
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().
This commit is contained in:
parent
ae8c98104a
commit
70353b79af
9 changed files with 152 additions and 88 deletions
|
@ -7,13 +7,34 @@
|
|||
|
||||
#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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue