Pinta.Core.AsyncEffectRenderer.GetTileBounds C# (CSharp) Method

GetTileBounds() private method

private GetTileBounds ( int tileIndex ) : Gdk.Rectangle
tileIndex int
return Gdk.Rectangle
		Gdk.Rectangle GetTileBounds (int tileIndex)
		{
			int horizTileCount = (int)Math.Ceiling((float)render_bounds.Width 
			                                       / (float)settings.TileWidth);
			
            int x = ((tileIndex % horizTileCount) * settings.TileWidth) + render_bounds.X;
            int y = ((tileIndex / horizTileCount) * settings.TileHeight) + render_bounds.Y;
            int w = Math.Min(settings.TileWidth, render_bounds.Right - x);
            int h = Math.Min(settings.TileHeight, render_bounds.Bottom - y);
			
			return new Gdk.Rectangle (x, y, w, h);			
		}