Skip to content

Commit

Permalink
ellipse on ellipse fully working
Browse files Browse the repository at this point in the history
  • Loading branch information
AnushaTiwari5 committed Oct 9, 2023
1 parent b776f05 commit 90d4725
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/AEG/Ellipse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class Ellipse {
//(x, y) = new point
//(h, k) = center

const p: number = Math.round(
const p: number = Math.ceil(
Math.pow(otherPoint.x - this.center.x, 2) / Math.pow(this.radiusX, 2) +
Math.pow(otherPoint.y - this.center.y, 2) / Math.pow(this.radiusY, 2)
);
Expand Down
2 changes: 1 addition & 1 deletion src/AtomCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function moveAtom(event: MouseEvent) {
function atomUp() {
const atomMetrics: TextMetrics = ctx.measureText(atom);
const newRect: Rectangle = new Rectangle(
new Point(currentPoint.x, currentPoint.y + atomMetrics.actualBoundingBoxAscent),
new Point(currentPoint.x, currentPoint.y - atomMetrics.actualBoundingBoxAscent),
atomMetrics.width,
atomMetrics.fontBoundingBoxDescent + atomMetrics.actualBoundingBoxAscent
);
Expand Down

0 comments on commit 90d4725

Please sign in to comment.