mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:12:43 +00:00 
			
		
		
		
	 220e34b69d
			
		
	
	
		220e34b69d
		
	
	
	
	
		
			
			Add the CanvasTextDrawingStyles mixin with the textAlign and textBaseline attributes. Update fill_text in CanvasRenderingContext2D to move the text rect by the text align and text baseline attributes. Wrote a simple HTML example to showcase the new features.
		
			
				
	
	
		
			15 lines
		
	
	
	
		
			687 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
	
		
			687 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| // https://html.spec.whatwg.org/multipage/canvas.html#canvaslinecap
 | |
| enum CanvasLineCap { "butt", "round", "square" };
 | |
| enum CanvasLineJoin { "round", "bevel", "miter" };
 | |
| 
 | |
| // https://html.spec.whatwg.org/multipage/canvas.html#canvaspathdrawingstyles
 | |
| interface mixin CanvasPathDrawingStyles {
 | |
|     attribute unrestricted double lineWidth;
 | |
|     // FIXME: attribute CanvasLineCap lineCap;
 | |
|     // FIXME: attribute CanvasLineJoin lineJoin;
 | |
|     // FIXME: attribute unrestricted double miterLimit;
 | |
| 
 | |
|     // FIXME: undefined setLineDash(sequence<unrestricted double> segments);
 | |
|     // FIXME: sequence<unrestricted double> getLineDash();
 | |
|     // FIXME: attribute unrestricted double lineDashOffset;
 | |
| };
 |