Skip to content

Commit

Permalink
chore: Change the source url of currency api
Browse files Browse the repository at this point in the history
  • Loading branch information
NriotHrreion committed May 2, 2024
1 parent beab50a commit 9b5c8c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/renderer/Render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ export default class Render extends Graphics {
// Draw function images
for(let i = 0; i < this.displayedPoints.length; i++) {
this.drawPoint(this.pointToScreen(this.displayedPoints.get(i)), this.colors.highlight);
// if(i < this.displayedPoints.length - 1) {
// this.drawLine(this.pointToScreen(this.displayedPoints.get(i)), this.pointToScreen(this.displayedPoints.get(i + 1)), this.colors.highlight);
// }
}

var imageBitmap = this.canvas.transferToImageBitmap();
Expand Down Expand Up @@ -295,15 +298,17 @@ export default class Render extends Graphics {
if(beginX < 0) beginX = 0;
if(endX < 0) return;
}

const dx = delta * this.spacing;

if(direction === MovingDirection.LEFT) {
for(let x = beginX; x <= endX; x += delta * this.spacing) {
for(let x = beginX; x <= endX; x += dx) {
// var y = await func.calculate(x);
// this.displayedPoints.add(this.createPoint(x, y));
this.calculatingWorker.postMessage({ type: "evaluate", id: func.id, mode: func.mode, root: func.root, x, operate: "add" });
}
} else {
for(let x = endX; x >= beginX; x -= delta * this.spacing) {
for(let x = endX; x >= beginX; x -= dx) {
// var y = await func.calculate(x);
// this.displayedPoints.unshift(this.createPoint(x, y));
this.calculatingWorker.postMessage({ type: "evaluate", id: func.id, mode: func.mode, root: func.root, x, operate: "unshift" });
Expand Down
2 changes: 1 addition & 1 deletion src/views/currency/CurrencyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Float from "@/compiler/Float";

import useEmitter from "@/hooks/useEmitter";

const fetchURL = "https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/";
const fetchURL = "https://unpkg.com/@fawazahmed0/currency-api@latest/v1/currencies/";

export enum CurrencyType {
USD = "USD",
Expand Down

1 comment on commit 9b5c8c8

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.