Skip to content
This repository has been archived by the owner on Aug 26, 2019. It is now read-only.

Commit

Permalink
Fixed #252: Opacity now works
Browse files Browse the repository at this point in the history
the opacity sliders for glyph opacity and background image are now functional. They stopped working after zoom was implemented but they now work.
  • Loading branch information
zoemcl committed Jul 26, 2017
1 parent fe7bb60 commit afae633
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/views/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Toe.View.GUI.prototype.setupNavBar = function() {
Toe.View.GUI.prototype.setupSideBar = function(parentDivId, toggles) {
// cache instance variable
var gui = this;
var elements = gui.rendEng.canvas.getObjects();

// create container for appearance sliders
if ($("#sidebar-app").length == 0) {
Expand All @@ -137,7 +138,9 @@ Toe.View.GUI.prototype.setupSideBar = function(parentDivId, toggles) {
'min="0.0" max="1.0" step="0.05" value="' + toggles.initBgImgOpacity + '" />\n</li>');

$("#sldr_bgImgOpacity").bind("change", function() {
gui.rendEng.canvas.backgroundImageOpacity = $(this).val();
if(elements[0]._element){
elements[0].opacity = $(this).val();
}
gui.rendEng.repaint();
});
}
Expand All @@ -151,7 +154,9 @@ Toe.View.GUI.prototype.setupSideBar = function(parentDivId, toggles) {
$("#sldr_glyphOpacity").bind("change", function() {
var opacity = $(this).val();
gui.rendEng.canvas.forEachObject(function(obj) {
obj.setOpacity(opacity);
if(obj.eleRef){
obj.setOpacity(opacity);
}
});

gui.rendEng.repaint();
Expand Down

0 comments on commit afae633

Please sign in to comment.