mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 18:12:43 +00:00 
			
		
		
		
	 e1f3fb0146
			
		
	
	
		e1f3fb0146
		
	
	
	
	
		
			
			The logic here is needed by InlineNode too. Moving it into a `paint_all_borders()` function makes it available to them both, as well as anyone else who wants it. :^)
		
			
				
	
	
		
			37 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibGfx/Forward.h>
 | |
| #include <LibWeb/CSS/ComputedValues.h>
 | |
| 
 | |
| namespace Web::Painting {
 | |
| 
 | |
| struct BorderRadiusData {
 | |
|     float top_left { 0 };
 | |
|     float top_right { 0 };
 | |
|     float bottom_right { 0 };
 | |
|     float bottom_left { 0 };
 | |
| };
 | |
| BorderRadiusData normalized_border_radius_data(Layout::Node const&, Gfx::FloatRect const&, CSS::Length top_left_radius, CSS::Length top_right_radius, CSS::Length bottom_right_radius, CSS::Length bottom_left_radius);
 | |
| 
 | |
| enum class BorderEdge {
 | |
|     Top,
 | |
|     Right,
 | |
|     Bottom,
 | |
|     Left,
 | |
| };
 | |
| struct BordersData {
 | |
|     CSS::BorderData top;
 | |
|     CSS::BorderData right;
 | |
|     CSS::BorderData bottom;
 | |
|     CSS::BorderData left;
 | |
| };
 | |
| void paint_border(PaintContext& context, BorderEdge edge, Gfx::FloatRect const& rect, BorderRadiusData const& border_radius_data, BordersData const& borders_data);
 | |
| void paint_all_borders(PaintContext& context, Gfx::FloatRect const& bordered_rect, BorderRadiusData const& border_radius_data, BordersData const&);
 | |
| 
 | |
| }
 |