diff --git a/src/ui/commands/cmd_renderer.js b/src/ui/commands/cmd_renderer.js index 9bcd94c75..05f3e1396 100644 --- a/src/ui/commands/cmd_renderer.js +++ b/src/ui/commands/cmd_renderer.js @@ -126,6 +126,7 @@ CABLES_CMD_RENDERER.changeSize = function () if (gui.canvasManager.getCanvasUiBar()) gui.canvasManager.getCanvasUiBar().showCanvasModal(false); + const p = new ModalDialog({ "prompt": true, "title": "Change Canvas size", diff --git a/src/ui/components/tabs/tab_gltimeline.js b/src/ui/components/tabs/tab_gltimeline.js index 7cac64920..a8ce0b6fc 100644 --- a/src/ui/components/tabs/tab_gltimeline.js +++ b/src/ui/components/tabs/tab_gltimeline.js @@ -1,10 +1,15 @@ import Tab from "../../elements/tabpanel/tab.js"; +import TabPanel from "../../elements/tabpanel/tabpanel.js"; import glTimelineCanvas from "../../gltimeline/gltimelinecanvas.js"; import { gui } from "../../gui.js"; import { userSettings } from "../usersettings.js"; export default class GlTimelineTab { + + /** + * @param {TabPanel} tabs + */ constructor(tabs) { this._tab = new Tab("gl timeline", { "icon": "timeline", "infotext": "gl timeline" }); @@ -16,10 +21,14 @@ export default class GlTimelineTab a.parentResized(); userSettings.set("glTimelineOpened", true); + this._tab.on("onActivate", () => + { + a.parentResized(); + }); + this._tab.addButton("rewind", () => { gui.corePatch().timer.setTime(0); - }); this._tab.addButton("rr", () => @@ -33,7 +42,6 @@ export default class GlTimelineTab if (gui.corePatch().timer.isPlaying())buttonPlay.innerHTML = "pause"; else buttonPlay.innerHTML = "play"; - }); this._tab.addButton("ff", () => @@ -51,6 +59,5 @@ export default class GlTimelineTab userSettings.set("glTimelineOpened", false); }); - // tabs.show(true); } } diff --git a/src/ui/gltimeline/gltimeline.js b/src/ui/gltimeline/gltimeline.js index 56011f3d0..72083a023 100644 --- a/src/ui/gltimeline/gltimeline.js +++ b/src/ui/gltimeline/gltimeline.js @@ -131,7 +131,7 @@ export default class GlTimeline extends Events let x = e.offsetX; let y = e.offsetY; - + console.log("gltl move", e.buttons); this.#rects.mouseMove(x, y, e.buttons, e); if (this.mouseDown) @@ -159,6 +159,9 @@ export default class GlTimeline extends Events this.mouseDown = true; } + /** + * @param {MouseEvent} e + */ _onCanvasMouseUp(e) { this.#rects.mouseUp(e); @@ -183,16 +186,25 @@ export default class GlTimeline extends Events return this.#cgl.canvasWidth; } + /** + * @param {number} t + */ timeToPixelScreen(t) { return this.timeToPixel(t) + this.titleSpace - this.timeToPixel(this.offset); } + /** + * @param {number} t + */ timeToPixel(t) { return t * this.#zoom * 12; } + /** + * @param {number} p + */ pixelToTime(p) { return p / this.timeToPixel(1);