Alternate low quality blur, fix cobweb over UI

alternate-visualiser
Will Toohey 10 years ago
parent 0235d7f35a
commit b055c75667
  1. 1
      css/hues-h.css
  2. 2
      index-min.html
  3. 2
      index.html
  4. 20
      js/HuesCanvas.js

@ -174,6 +174,7 @@
.hues-h-topleft, .hues-h-topright, .hues-h-bottomright {
position: absolute;
background-repeat: no-repeat;
z-index: -9;
}
.hues-h-topleft, .hues-h-topright {

@ -93,7 +93,7 @@
<li>[R] Resource packs</li>
<li>[O] Options</li>
<li>[I] Information</li>
<li>[1-4] Change UI</li>
<li>[1-5] Change UI</li>
</ul>
</div>
</div>

@ -104,7 +104,7 @@
<li>[R] Resource packs</li>
<li>[O] Options</li>
<li>[I] Information</li>
<li>[1-4] Change UI</li>
<li>[1-5] Change UI</li>
</ul>
</div>
</div>

@ -135,12 +135,24 @@ HuesCanvas.prototype.redraw = function() {
this.canvas.globalAlpha = this.blurAlpha;
}
if(this.xBlur) {
for(var i=-1; i<=1; i+= this.blurDelta) {
this.canvas.drawImage(bitmap, Math.floor(this.blurDistance * i) + offset, 0);
if(this.blurIterations < 0) {
this.canvas.globalAlpha = 1;
this.canvas.drawImage(bitmap, Math.floor(offset - this.blurDistance/2), 0,
bitmap.width + this.blurDistance, bitmap.height);
} else {
for(var i=-1; i<=1; i+= this.blurDelta) {
this.canvas.drawImage(bitmap, Math.floor(this.blurDistance * i) + offset, 0);
}
}
} else if(this.yBlur) {
for(var i=-1; i<=1; i+= this.blurDelta) {
this.canvas.drawImage(bitmap, offset, Math.floor(this.blurDistance * i));
if(this.blurIterations < 0) {
this.canvas.globalAlpha = 1;
this.canvas.drawImage(bitmap, offset, Math.floor(-this.blurDistance/2),
bitmap.width, bitmap.height + this.blurDistance);
} else {
for(var i=-1; i<=1; i+= this.blurDelta) {
this.canvas.drawImage(bitmap, offset, Math.floor(this.blurDistance * i));
}
}
} else {
this.canvas.globalAlpha = 1;

Loading…
Cancel
Save