public CPBrushDab getDab(float x, float y, CPBrushInfo brushInfo) {
		CPBrushDab dab = new CPBrushDab();
		dab.alpha = brushInfo.curAlpha;

		// FIXME: I don't like this special case for ROUND_PIXEL
		// it would be better to have brush presets for working with pixels
		boolean useAA = brushInfo.isAA && brushInfo.type != CPBrushInfo.B_ROUND_PIXEL;

		dab.width = (int) (brushInfo.curSize + .99f);
		dab.height = (int) (brushInfo.curSize + .99f);

		if (useAA) {
			dab.width++;
			dab.height++;
		}

		float nx = x - dab.width / 2.f + .5f;
		float ny = y - dab.height / 2.f + .5f;

		// this is necessary as Java uses convert towards zero float to int conversion
		if (nx < 0) {
			nx -= 1;
		}
		if (ny < 0) {
			ny -= 1;
		}

		if (useAA) {
			float dx = Math.abs(nx - ((int) nx));
			float dy = Math.abs(ny - ((int) ny));
			dab.brush = getBrushWithAA(brushInfo, dx, dy);
		} else {
			dab.brush = getBrush(brushInfo);
		}

		dab.x = (int) nx;
		dab.y = (int) ny;

		if (brushInfo.texture > 0.f && texture != null) {
			// we need a brush bitmap that can be modified everytime
			// the one in "brush" can be kept in cache so if we are using it, make a copy
			if (dab.brush == brush) {
				System.arraycopy(brush, 0, brushAA, 0, dab.width * dab.height);
				dab.brush = brushAA;
			}
			applyTexture(dab, brushInfo.texture);
		}
		return dab;
	}