Skip to content

Commit

Permalink
Rounding for bounds inputs. Fixed bug when determining whether edit s…
Browse files Browse the repository at this point in the history
…hould be disabled.
  • Loading branch information
Phil committed Dec 12, 2013
1 parent 3ebee91 commit 4ac0805
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/listen/listen.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ angular.module('bawApp.listen', ['decipher.tags', 'ui.bootstrap.typeahead'])
};

$scope.singleEditDisabled = function () {
return ($scope.model.selectedAudioEvent.id === undefined);
return ($scope.model.selectedAudioEvent === null || $scope.model.selectedAudioEvent.id === undefined);
};


Expand Down
4 changes: 4 additions & 0 deletions src/components/services/unitConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,14 @@ uc.factory("bawApp.unitConverter", ['conf.constants', function (constants) {
conversions: conversions,
pixelsToSeconds: function pixelsToSeconds(pixels) {
var seconds = pixels / conversions.pixelsPerSecond;
var m = Math.pow(10, constants.unitConverter.precisionSeconds);
seconds = Math.round(seconds * m) / m;
return seconds;
},
pixelsToHertz: function pixelsToHertz(pixels) {
var hertz = pixels / conversions.pixelsPerHertz;
var m = Math.pow(10, constants.unitConverter.precisionHertz);
hertz = Math.round(hertz * m) / m;
return hertz;
},
secondsToPixels: function secondsToPixels(seconds) {
Expand Down

0 comments on commit 4ac0805

Please sign in to comment.