No way to alter GeomGraph radX and radY effectively
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 175
- Forks
- 18
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 4
Description
GeomGraph has public attributes radX and radY which contain the corner radius of the graph's bounding rectangle, used when determining the boundaryCurve for the graph.
radXandradYinGeomGraphare assigned10in the constructor. The constructor then immediately uses these values to constructrrect: RRect.boundaryCurvecannot be altered directly: the setter throws an exception.- It can be altered by assigning
boundingBox, but in this case it copies the corner radii from the existingRRect, which have previously been assigned10. - So changing
radXandradYafter constructing the graph does not affect subsequence alterations ofboundingBox: they continue to use the values embedded in theboundingBoxRRect.
This leaves no apparent API for altering the corner radii.
Expected behavior:
- changing
radXorradYafter constructing aGeomGraphand then assigningboundingBoxshould create a boundaryCurve with the new radii. - or a more sophisticated API for either constructing
GeomGraphwith configurable corner radii - or assigning
radXandradYinvalidates the existingboundaryShape - or allow a direct assignment of
rrect.
My current workaround uses the last method (which breaks encapsulation):
function setCornerRadius(graph: GeomGraph, radius: number) {
const bounds = graph.boundingBox;
const rrect = new RRect({left: bounds.left, top: bounds.top, right: bounds.right, bottom: bounds.bottom, radX: radius, radY: radius});
(graph as any).rrect = rrect;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating GeomGraph and inspect its constructor, radX/radY attributes, boundingBox setter, boundaryCurve setter, and internal rrect handling. Reproduce the reported sequence of changing the radii and assigning boundingBox, then verify that the chosen API behavior makes the resulting boundaryCurve use the requested corner radii.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100