mirror of
				https://github.com/NoelFB/blah.git
				synced 2025-11-04 01:41:34 +08:00 
			
		
		
		
	fix incorrect pixel offset in asset packer trim
This commit is contained in:
		@ -40,7 +40,7 @@ void Packer::add_entry(u64 id, int w, int h, const Color* pixels, const Recti& s
 | 
			
		||||
 | 
			
		||||
	// TOP:
 | 
			
		||||
	for (int y = source.y; y < source.y + source.h; y++)
 | 
			
		||||
		for (int x = source.x, s = y * w; x < source.x + source.w; x++, s++)
 | 
			
		||||
		for (int x = source.x, s = x + y * w; x < source.x + source.w; x++, s++)
 | 
			
		||||
			if (pixels[s].a > 0)
 | 
			
		||||
			{
 | 
			
		||||
				top = y;
 | 
			
		||||
@ -304,4 +304,4 @@ Packer::Node* Packer::Node::reset(const Recti& rect)
 | 
			
		||||
	right = nullptr;
 | 
			
		||||
	down = nullptr;
 | 
			
		||||
	return this;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user