You know how you can select a vector graphic in a Vector Graphic Editor like Adobe Illustrator, and some handles appear on it, and you can drag them to resize the graphic, and the whole thing rescales/resizes proportionally, including all of the line thicknesses? I'm trying to enable that ability programmatically for ProJucer's component preview, since you can dynamically resize your components. The struggle to make it work for the lineThickness parameter in methods like:
drawRoundedRectangle (Rectangle< float > rectangle, float cornerSize, float lineThickness) const
drawEllipse (Rectangle< float > area, float lineThickness) const
drawDashedLine (const Line< float > &line, const float *dashLengths, int numDashLengths, float lineThickness=1.0f, int dashIndexToStartFrom=0) const
strokePath (const Path &path, const PathStrokeType &strokeType, const AffineTransform &transform=AffineTransform()) const
drawLine(const Line< float > &line, float lineThickness) const
I suppose you could say I'm trying to figure out how to programmatically use
Path::getTransformToScaleToFit() to let me emulate that resize/rescale/zoom feature in Projucer's Live Component Preview, that is found in a lot of vector graphic creation programs.
heh, we need a
getTransformToScaleToFit() for the lineThickness parameter Now that I've figured out how to express what i'm actually trying to accomplish (that's always half the battle, isn't it?), any ideas on accomplishing that?
essentially how to do this:
g.drawRoundedRectangle(getLocalBounds().toFloat(), scalingCornerSize(), scalingLineThickness() );