private Vector2Int getTileFirstPixel(Vector2Int tilePosition, SliceData sliceData) { return(new Vector2Int { x = tilePosition.x * tileWidth + sliceData.offsetX + sliceData.paddingX * tilePosition.x, y = tilePosition.y * tileHeight + sliceData.offsetY + sliceData.paddingY * tilePosition.y }); }
private void SetDestSliceData() { var reSlice = false; destSliceData = srcSliceData; if (destSliceData.offsetX < 1) { destSliceData.offsetX = 1; Warning("Output X Offset increased to 1."); reSlice = true; } if (destSliceData.offsetY < 1) { destSliceData.offsetY = 1; Warning("Output Y Offset increased to 1."); reSlice = true; } if (destSliceData.paddingX < 2) { destSliceData.paddingX = 2; Warning("Output X Padding increased to 2."); reSlice = true; } if (destSliceData.paddingY < 2) { destSliceData.paddingY = 2; Warning("Output Y Padding increased to 2."); reSlice = true; } if (reSlice) { Message("If the image has previously been sliced, please " + "re-slice with any\nnew values after fixing the image."); } }