mirror of
				https://github.com/excalidraw/excalidraw.git
				synced 2025-11-03 20:34:40 +01:00 
			
		
		
		
	Add Text Colors (#67)
* Add ability to choose a color when creating text elements * use strokeColor instead of adding a new field
This commit is contained in:
		
				
					committed by
					
						
						Christopher Chedeau
					
				
			
			
				
	
			
			
			
						parent
						
							527209e740
						
					
				
				
					commit
					f2386eb131
				
			@@ -345,11 +345,14 @@ function generateDraw(element: ExcaliburElement) {
 | 
			
		||||
    element.draw = (rc, context) => {
 | 
			
		||||
      const font = context.font;
 | 
			
		||||
      context.font = element.font;
 | 
			
		||||
      const fillStyle = context.fillStyle;
 | 
			
		||||
      context.fillStyle = element.strokeColor;
 | 
			
		||||
      context.fillText(
 | 
			
		||||
        element.text,
 | 
			
		||||
        element.x,
 | 
			
		||||
        element.y + element.actualBoundingBoxAscent
 | 
			
		||||
      );
 | 
			
		||||
      context.fillStyle = fillStyle;
 | 
			
		||||
      context.font = font;
 | 
			
		||||
    };
 | 
			
		||||
  } else {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user