fix shapes display for the simple example

This commit is contained in:
Felipe Cecagno 2018-07-11 22:27:25 -03:00
parent 494b007ade
commit 79c13621d7

View File

@ -65,7 +65,7 @@ var timestampToIdKeys = [];
var mainShapeIds = {}; var mainShapeIds = {};
var currentImage = null; var currentImage = null;
var currentImageId = "image0"; var currentImageId = "image0";
var shapesArray = {}; var shapesArray = [];
var timestampToId = {}; var timestampToId = {};
var shapesSVGContent = null; var shapesSVGContent = null;
var slideAspectValues = {}; var slideAspectValues = {};
@ -385,7 +385,6 @@ function runPopcorn() {
lastFrameTime = currentTime; lastFrameTime = currentTime;
// Get the time and round to 1 decimal place // Get the time and round to 1 decimal place
var t = currentTime.toFixed(1); var t = currentTime.toFixed(1);
let currentShapes = getShapesAtTime(t);
// Create an object referencing the main versions of all the shapes // Create an object referencing the main versions of all the shapes
var current_shapes = Object.create(mainShapeIds); var current_shapes = Object.create(mainShapeIds);
@ -703,9 +702,9 @@ function processShapesSVG(response) {
shapesSVGContent = response.responseXML; shapesSVGContent = response.responseXML;
// Getting all the event tags // Getting all the event tags
let shapeelement = response.responseXML.getElementsByTagName("svg")[0]; let shapeelement = shapesSVGContent.getElementsByTagName("svg")[0];
// Get an array of the elements for each "shape" in the drawing // Get an array of the elements for each "shape" in the drawing
let shapesArray = response.responseXML.querySelectorAll('g[class="shape"]'); shapesArray = shapesSVGContent.querySelectorAll('g[class="shape"]');
// To assist in finding the version of a shape shown at a particular time // To assist in finding the version of a shape shown at a particular time
// (while being drawn, during updates), provide a lookup from time to id // (while being drawn, during updates), provide a lookup from time to id