mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 05:12:44 +00:00 
			
		
		
		
	 5aad32b504
			
		
	
	
		5aad32b504
		
	
	
	
	
		
			
			We don't yet take the spread-distance parameter into account, since we don't have a way to "inflate" the text shadow. Also, I'm not sure if we need to inflate the shadow slightly anyway. Blurred shadows of our pixel fonts seem very faint. Part of this is that a blur of < 3px does nothing, see #13231, but even so we might want to inflate it a little.
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			656 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			656 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibGfx/Color.h>
 | |
| #include <LibWeb/Forward.h>
 | |
| #include <LibWeb/Painting/PaintContext.h>
 | |
| 
 | |
| namespace Web::Painting {
 | |
| 
 | |
| enum class ShadowPlacement {
 | |
|     Outer,
 | |
|     Inner,
 | |
| };
 | |
| 
 | |
| struct ShadowData {
 | |
|     Gfx::Color color;
 | |
|     int offset_x;
 | |
|     int offset_y;
 | |
|     int blur_radius;
 | |
|     int spread_distance;
 | |
|     ShadowPlacement placement;
 | |
| };
 | |
| 
 | |
| void paint_box_shadow(PaintContext&, Gfx::IntRect const&, Vector<ShadowData> const&);
 | |
| void paint_text_shadow(PaintContext&, Layout::LineBoxFragment const&, Vector<ShadowData> const&);
 | |
| 
 | |
| }
 |