08-06-2018, 05:13 PM
If I generate two ArtboardPoints 14400 px apart and draw a line between them with hdi::core::draw::line, the line falls where I'd expect it to.
Next I convert the ArtboardPoints to Points using the code below:
When I store the two points and draw a line between them in my annotation callback, it works correctly at zoom levels under 400%. Any time I'm zoomed in 400% or more, the line goes through the screen area, but the two points are far from the correct locations.
If, however, I space the points 14400 divided by my current zoom level, the line is drawn correctly. Is this a bug in calculating the artworkPointToViewPoint when the values are too large? Or perhaps it's a known limitation I should have been aware of.
Thanks!
-- Rick
Next I convert the ArtboardPoints to Points using the code below:
Code:
// hdi::core::ArtboardPoint ABpt defined elsewhere
hdi::core::CurrentDocument* currDoc = HDI_CORE_ILLUSTRATOR->currentDocument();
hdi::core::Point Pt = currDoc->currentView()->artworkPointToViewPoint(ABpt);
When I store the two points and draw a line between them in my annotation callback, it works correctly at zoom levels under 400%. Any time I'm zoomed in 400% or more, the line goes through the screen area, but the two points are far from the correct locations.
If, however, I space the points 14400 divided by my current zoom level, the line is drawn correctly. Is this a bug in calculating the artworkPointToViewPoint when the values are too large? Or perhaps it's a known limitation I should have been aware of.
Thanks!
-- Rick