mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:32:43 +00:00 
			
		
		
		
	LibDraw: Painter::draw_pixel() with thickness>1 was doubly translating
Callers of draw_pixel() are not expecting it to apply translation since they will have already done that themselves. This was causing draw_line() with thickness>1 to have an offset applied in case the painter was already translated.
This commit is contained in:
		
							parent
							
								
									e2b88f66d3
								
							
						
					
					
						commit
						f04394b9f3
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -770,7 +770,7 @@ void Painter::draw_pixel(const Point& position, Color color, int thickness) | |||
|     if (thickness == 1) | ||||
|         return set_pixel_with_draw_op(m_target->scanline(position.y())[position.x()], color); | ||||
|     Rect rect { position.translated(-(thickness / 2), -(thickness / 2)), { thickness, thickness } }; | ||||
|     fill_rect(rect, color); | ||||
|     fill_rect(rect.translated(-state().translation), color); | ||||
| } | ||||
| 
 | ||||
| void Painter::draw_line(const Point& p1, const Point& p2, Color color, int thickness, bool dotted) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling