MobileSheets Forums

Full Version: Database Internal: Draw paths
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The path for a freehand annotation (draw or highlight) consists of a series of X,Y points.
I notice that:
  • The first and second point always are identical, and several other points are (also) duplicated. Is this due to the way the digitizer sends data?
  • Occasionally and out-of-band value occurs (IEEE 32-bitf MAX_FLOAT, or 0xFFFFFFFFFFFFFFFF) apparently to denote the end of a stroke, however, this is always followed by another point. Does this mean that 0xFFFFFFFFFFFFFFFF indicates to end the stroke at the next point?
Thanks,
If the first and second points are the same, that's just the result of what the digitizer sent me. As a side note, I go through the points array and remove redundant points, but I believe I only start doing that from the 2nd point on (which will make sense after the end of my explanation). MAX_FLOAT does denote the end of the stroke, but the point after it also belongs to the same stroke. Why did I do it this way? I'm currently using a Path object, and I have to do a moveTo and lineTo with the first point and a lineTo with the last point, but everything in between is a quadTo. It just made it simpler to do moveTo on the first point, read until MAX_FLOAT, and then do a lineTo on the last point to complete the stroke in the Path object. From there, I can draw the next stroke if the array happens to contain more than one.
Thanks for the explanation.