public int getYOffset(int i) {
		if (offsets == null)
			return 0;
		if (i >= 0 && i < offsets.length) {
			if (offsets[i] == null)
				return 0;
			return offsets[i].y;
		}
		if (i < 0) {
			if (offsets[0] == null)
				return 0;
			return offsets[0].y;
		}
		if (i >= offsets.length && offsets.length > 0) {
			if (offsets[offsets.length - 1] == null)
				return 0;
			return offsets[offsets.length - 1].y;
		}
		return 0;
	}