2023-11-19 22:03:48 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <LibWeb/Painting/BordersData.h>
|
2025-07-31 23:07:26 +02:00
|
|
|
#include <LibWeb/Painting/DisplayListRecordingContext.h>
|
2023-11-19 22:03:48 +01:00
|
|
|
|
|
|
|
|
namespace Web::Painting {
|
|
|
|
|
|
2025-07-31 23:07:26 +02:00
|
|
|
BordersDataDevicePixels BordersData::to_device_pixels(DisplayListRecordingContext const& context) const
|
2023-11-19 22:03:48 +01:00
|
|
|
{
|
|
|
|
|
return BordersDataDevicePixels {
|
|
|
|
|
BorderDataDevicePixels {
|
|
|
|
|
top.color,
|
|
|
|
|
top.line_style,
|
|
|
|
|
context.enclosing_device_pixels(top.width).value() },
|
|
|
|
|
BorderDataDevicePixels {
|
|
|
|
|
right.color,
|
|
|
|
|
right.line_style,
|
|
|
|
|
context.enclosing_device_pixels(right.width).value() },
|
|
|
|
|
BorderDataDevicePixels {
|
|
|
|
|
bottom.color,
|
|
|
|
|
bottom.line_style,
|
|
|
|
|
context.enclosing_device_pixels(bottom.width).value() },
|
|
|
|
|
BorderDataDevicePixels {
|
|
|
|
|
left.color,
|
|
|
|
|
left.line_style,
|
|
|
|
|
context.enclosing_device_pixels(left.width).value() }
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|