Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babylonjs/controls

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babylonjs/controls - npm Package Compare versions

Comparing version 1.0.0-alpha.13 to 1.0.0-alpha.14

17

dist/src/timeline/timeline.js

@@ -57,3 +57,3 @@ import { EffectWrapper, EffectRenderer } from "@babylonjs/core/Materials/effectRenderer";

get maxSettableTime() {
return this._totalDuration - this._visibleDuration;
return Math.max(this._totalDuration - this._visibleDuration, 0);
}

@@ -150,7 +150,16 @@ /**

const startTime = Math.floor(thumbnailIndex) * this._intervalDuration;
// Computes a filler offsets for the width to ensure the timeline is centered.
let filler = 0;
if (this._totalDuration < this._visibleThumbnails) {
const offset = this._visibleThumbnails - this._totalDuration;
filler = offset / 2;
}
// Renders all the visible thumbnails in the timeline.
for (let i = 0; i < this._visibleThumbnails + 1; i++) {
const time = startTime + this._intervalDuration * i;
if (time >= this._totalDuration) {
break;
}
// Set the texture corresponding to the current time.
const texture = this._getTexture(Math.floor(time));
const texture = this._getTexture(time);
this._effectWrapper.effect.setTexture("thumbnail", texture);

@@ -160,3 +169,3 @@ // Computes the horizontal offset of the thumbnail dynamically by respecting

// shaderOffset = offset * 2. - 1.;
const widthOffset = (time - this._currentTime) / this._visibleDuration * 2 - 1;
const widthOffset = ((time - this._currentTime) + filler) / this._visibleDuration * 2 - 1;
this._effectWrapper.effect.setFloat2("offset", widthOffset, this._heightOffset);

@@ -248,3 +257,3 @@ this._effectWrapper.effect.setFloat2("scale", this._widthScale, this._heightScale);

// Ensures the provided total duration is meaningful.
this._totalDuration = Math.max(0, this._options.totalDuration);
this._totalDuration = Math.floor(Math.max(0, this._options.totalDuration));
if (this._totalDuration === 0) {

@@ -251,0 +260,0 @@ Logger.Error("The total duration can not be 0. Nothing would be displayed.");

{
"name": "@babylonjs/controls",
"version": "1.0.0-alpha.13",
"version": "1.0.0-alpha.14",
"description": "Babylon.js controls are a set of regular web controls that used hardware accelerated rendering through Babylon.js to provide blazing fast dedicated controls.",

@@ -5,0 +5,0 @@ "author": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc