diff --git a/src/AEG/Ellipse.ts b/src/AEG/Ellipse.ts index d3fdd4a4..25d5f8da 100644 --- a/src/AEG/Ellipse.ts +++ b/src/AEG/Ellipse.ts @@ -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) ); diff --git a/src/AtomCreation.ts b/src/AtomCreation.ts index 639b3a94..6a7cb51a 100644 --- a/src/AtomCreation.ts +++ b/src/AtomCreation.ts @@ -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 );