Hydra is now an optional load

This commit is contained in:
2024-04-17 01:54:41 +02:00
parent 75daa2cf6a
commit 7100d5a470
7 changed files with 68 additions and 44 deletions

View File

@ -122,6 +122,7 @@ export class UserAPI {
getThemes: () => string[];
pulseLocation: () => number;
clear: () => boolean;
loadHydra: () => void;
w: () => number;
h: () => number;
hc: () => number;
@ -294,6 +295,7 @@ export class UserAPI {
this.nextTheme = Theme.nextTheme(this.app);
this.getThemes = Theme.getThemes();
this.pulseLocation = Canvas.pulseLocation(this.app);
this.loadHydra = Canvas.loadHydra(this.app);
this.clear = Canvas.clear(this.app);
this.w = Canvas.w(this.app);
this.h = Canvas.h(this.app);

View File

@ -2,6 +2,11 @@ import { OscilloscopeConfig } from "../DOM/Visuals/Oscilloscope";
import { ShapeObject, createConicGradient, createLinearGradient, createRadialGradient, drawBackground, drawBox, drawBall, drawBalloid, drawDonut, drawEquilateral, drawImage, drawPie, drawSmiley, drawStar, drawStroke, drawText, drawTriangular } from "../DOM/Visuals/CanvasVisuals";
import { Editor } from "../main";
export const loadHydra = (app: Editor) => (): void => {
app.ensureHydraLoaded()
}
export const w = (app: Editor) => (): number => {
const canvas: HTMLCanvasElement = app.interface.feedback as HTMLCanvasElement;
return canvas.clientWidth;