Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
pandrr committed Jan 29, 2025
1 parent 42c791f commit 194cdb5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/ui/commands/cmd_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 10 additions & 3 deletions src/ui/components/tabs/tab_gltimeline.js
Original file line number Diff line number Diff line change
@@ -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" });
Expand All @@ -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", () =>
Expand All @@ -33,7 +42,6 @@ export default class GlTimelineTab

if (gui.corePatch().timer.isPlaying())buttonPlay.innerHTML = "pause";
else buttonPlay.innerHTML = "play";

});

this._tab.addButton("ff", () =>
Expand All @@ -51,6 +59,5 @@ export default class GlTimelineTab
userSettings.set("glTimelineOpened", false);
});

// tabs.show(true);
}
}
14 changes: 13 additions & 1 deletion src/ui/gltimeline/gltimeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -159,6 +159,9 @@ export default class GlTimeline extends Events
this.mouseDown = true;
}

/**
* @param {MouseEvent} e
*/
_onCanvasMouseUp(e)
{
this.#rects.mouseUp(e);
Expand All @@ -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);
Expand Down

0 comments on commit 194cdb5

Please sign in to comment.