wxGraphicsPath(3erl)
π wxGraphicsPath β Erlang Module Definition π
okay bestie, sit down, this one is a whole module definition page for wxGraphicsPath, and honestly? it's giving "drawing things with math" and I'm obsessed π¨β¨
πΈ NAME πΈ
wxGraphicsPath β literally just the functions for the wxGraphicsPath class π«Ά
π¦ DESCRIPTION π¦
so. a wxGraphicsPath is a native representation of a geometric path. and when they say native they mean it β the contents are specific and private to the respective renderer. like, it's renderer's business, not yours, iykyk π
instances are reference counted, so you can assign them like a normal, well-adjusted term. slay.
the only way to get a valid instance is by usingwxGraphicsContext:createPath/1orwxGraphicsRenderer:createPath/1. that's it. that's the door. no shortcuts, no cap π₯
this class is derived (and can use functions) from: wxGraphicsObject
wxWidgets docs: wxGraphicsPath β go off, official docs π
π DATA TYPES π
wxGraphicsPath()=wx:wx_object()
β EXPORTS β
π moveToPoint(This, P) -> ok
This = wxGraphicsPath()
P = {X :: float(), Y :: float()}
begins a new subpath at p β¨
π moveToPoint(This, X, Y) -> ok
This = wxGraphicsPath()
X = Y = number()
begins a new subpath at (<em>x</em>,<em>y</em>). same energy, different arg shape π
π§ addArc(This, C, R, StartAngle, EndAngle, Clockwise) -> ok
This = wxGraphicsPath()
C = {X :: float(), Y :: float()}
R = StartAngle = EndAngle = number()
Clockwise = boolean()
π§ addArc(This, X, Y, R, StartAngle, EndAngle, Clockwise) -> ok
This = wxGraphicsPath()
X = Y = R = StartAngle = EndAngle = number()
Clockwise = boolean()
adds an arc of a circle π΅
the circle is defined by the coordinates of its centre (<em>x</em>, <em>y</em>) or c and its radius r. the arc goes from the starting angle startAngle to endAngle either clockwise or counter-clockwise depending on the value of the clockwise argument.
the angles are measured in radians but, contrary to the usual mathematical convention, are always clockwise from the horizontal axis. yeah, it's built different, don't fight it π
- if for clockwise arc endAngle is less than startAngle it will be progressively increased by
2*piuntil it is greater than startAngle. - if for counter-clockwise arc endAngle is greater than startAngle it will be progressively decreased by
2*piuntil it is less than startAngle.
if there is a current point set, an initial line segment will be added to the path to connect the current point to the beginning of the arc. cute. thoughtful. iconic π«Ά
π addArcToPoint(This, X1, Y1, X2, Y2, R) -> ok
This = wxGraphicsPath()
X1 = Y1 = X2 = Y2 = R = number()
adds an arc (of a circle with radius r) that is tangent to the line connecting current point and (<em>x1</em>, <em>y1</em>) and to the line connecting (<em>x1</em>, <em>y1</em>) and (<em>x2</em>, <em>y2</em>) π
if the current point and the starting point of the arc are different, a straight line connecting these points is also appended. if there is no current point before the call to addArcToPoint/6 this function will behave as if preceded by a call to MoveToPoint(0, 0). after this call the current point will be at the ending point of the arc β¨
π addCircle(This, X, Y, R) -> ok
This = wxGraphicsPath()
X = Y = R = number()
appends a circle around (<em>x</em>,<em>y</em>) with radius r as a new closed subpath.
after this call the current point will be at (<em>x</em>+r, <em>y*). noted. remembered. main character coordinates π
π addCurveToPoint(This, C1, C2, E) -> ok
This = wxGraphicsPath()
C1 = C2 = E = {X :: float(), Y :: float()}
adds a cubic bezier curve from the current point, using two control points and an end point π’
if there is no current point before the call to addCurveToPoint/7 this function will behave as if preceded by a call to MoveToPoint(c1).
π addCurveToPoint(This, Cx1, Cy1, Cx2, Cy2, X, Y) -> ok
This = wxGraphicsPath()
Cx1 = Cy1 = Cx2 = Cy2 = X = Y = number()
adds a cubic bezier curve from the current point, using two control points and an end point. same deal, flatter args:
if there is no current point before the call to addCurveToPoint/7 this function will behave as if preceded by a call to MoveToPoint(cx1, cy1). periodt π«‘
πΈ addEllipse(This, X, Y, W, H) -> ok
This = wxGraphicsPath()
X = Y = W = H = number()
appends an ellipse fitting into the passed in rectangle as a new closed subpath π₯
after this call the current point will be at (<em>x</em>+w, <em>y*+h/2).
π¦ addLineToPoint(This, P) -> ok
This = wxGraphicsPath()
P = {X :: float(), Y :: float()}
adds a straight line from the current point to p π
if current point is not yet set before the call to addLineToPoint/3 this function will behave as moveToPoint/3.
π¦ addLineToPoint(This, X, Y) -> ok
This = wxGraphicsPath()
X = Y = number()
adds a straight line from the current point to (<em>x</em>,<em>y</em>).
if current point is not yet set before the call to addLineToPoint/3 this function will behave as moveToPoint/3. literally the same rule, no cap π
π addPath(This, Path) -> ok
This = Path = wxGraphicsPath()
adds another path onto the current path π«Ά
after this call the current point will be at the added path's current point.
β οΈ for Direct2D the path being appended shouldn't contain a started non-empty subpath when this function is called. like, just don't. fr fr π
π addQuadCurveToPoint(This, Cx, Cy, X, Y) -> ok
This = wxGraphicsPath()
Cx = Cy = X = Y = number()
adds a quadratic bezier curve from the current point, using a control point and an end point π’β¨
if there is no current point before the call to addQuadCurveToPoint/5 this function will behave as if preceded by a call to MoveToPoint(cx, cy).
π addRectangle(This, X, Y, W, H) -> ok
This = wxGraphicsPath()
X = Y = W = H = number()
appends a rectangle as a new closed subpath π¦
after this call the current point will be at (<em>x</em>, <em>y</em>).
π§ addRoundedRectangle(This, X, Y, W, H, Radius) -> ok
This = wxGraphicsPath()
X = Y = W = H = Radius = number()
appends a rounded rectangle as a new closed subpath π¨β¨
if radius equals 0 this function will behave as addRectangle/5, otherwise after this call the current point will be at (<em>x</em>+w, <em>y*+h/2). yes, the corner-case is literally a corner case, I'm hilarious π
π closeSubpath(This) -> ok
This = wxGraphicsPath()
closes the current sub-path π
after this call the current point will be at the joined endpoint of the sub-path.
π contains(This, C) -> boolean()
This = wxGraphicsPath()
C = {X :: float(), Y :: float()}
π contains(This, X, Y) -> boolean()
π contains(This, C, Y :: [Option]) -> boolean()
This = wxGraphicsPath()
C = {X :: float(), Y :: float()}
Option = {fillStyle, wx:wx_enum()}
return: true if the point is within the path β¨
π contains(This, X, Y, Options :: [Option]) -> boolean()
This = wxGraphicsPath()
X = Y = number()
Option = {fillStyle, wx:wx_enum()}
return: true if the point is within the path. vibe check: the point passes the vibe check when it's inside π«Ά
β getBox(This) -> {X :: float(), Y :: float(), W :: float(), H :: float()}
This = wxGraphicsPath()
gets the bounding box enclosing all points (possibly including control points) π¦
π¦ getCurrentPoint(This) -> {X :: float(), Y :: float()}
This = wxGraphicsPath()
gets the last point of the current path, (0,0) if not yet set. default behavior, we love a sensible default π
π₯ transform(This, Matrix) -> ok
This = wxGraphicsPath()
Matrix = wxGraphicsMatrix:wxGraphicsMatrix()
transforms each point of this path by the matrix π«
β οΈ for Direct2D the current path shouldn't contain a started non-empty subpath when this function is called. same warning, different function, still serious π
π that's the whole page bestie π
and now the sign-off: this lil beauty came from the wxWidgets team ππΊ β the docs are tagged wx 2.2.2.1 (both as the version and as the date on this page), so when you're citing it you can be like "per wx 2.2.2.1, obviously" π
β¨ mwah, go draw some paths π¦πΈ
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms