# HG changeset patch # User hamidouk # Date 1326794433 -3600 # Node ID 0c8ca890c9f10dbf8ee6c1014ee1bf37b554fad1 # Parent 492d3c8d776ab2ca1b95e7197f6ba7edeb9c4dec fixed update bug. diff -r 492d3c8d776a -r 0c8ca890c9f1 src/js/widgets/createAnnotationWidget.js --- a/src/js/widgets/createAnnotationWidget.js Mon Jan 16 17:27:23 2012 +0100 +++ b/src/js/widgets/createAnnotationWidget.js Tue Jan 17 11:00:33 2012 +0100 @@ -271,10 +271,10 @@ } } else { var duration = +this._serializer.currentMedia().meta["dc:duration"]; - annotation["begin"] = +((duration * (this.sliceLeft / this.selector.width())).toFixed(0)); - annotation["end"] = +((duration * ((this.sliceWidth + this.sliceLeft) / this.selector.width())).toFixed(0)); + annotation["begin"] = +((duration * (this.sliceLeft / 100)).toFixed(0)); + annotation["end"] = +((duration * ((this.sliceWidth + this.sliceLeft) / 100)).toFixed(0)); } - + annotation["type"] = this._serializer.getContributions(); if (typeof(annotation["type"]) === "undefined") annotation["type"] = ""; diff -r 492d3c8d776a -r 0c8ca890c9f1 src/js/widgets/sparklineWidget.js --- a/src/js/widgets/sparklineWidget.js Mon Jan 16 17:27:23 2012 +0100 +++ b/src/js/widgets/sparklineWidget.js Tue Jan 17 11:00:33 2012 +0100 @@ -101,7 +101,7 @@ IriSP.SparklineWidget.prototype.handleNewAnnotation = function(annotation) { var num_columns = (this.selector.width()) / IriSP.widgetsDefaults["SparklineWidget"].column_width; var duration = +this._serializer.currentMedia().meta["dc:duration"]; - var time_step = duration / num_columns; /* the time interval between two columns */ + var time_step = Math.round(duration / num_columns); /* the time interval between two columns */ var begin = +annotation.begin; var index = Math.floor(begin / time_step);