Skip to content

Commit

Permalink
Remove unecessary window.devicePixelRatio adjustments that cause zoom…
Browse files Browse the repository at this point in the history
…ing errors.
  • Loading branch information
Luxapodular committed Apr 15, 2020
1 parent 00873b4 commit 70dc46f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions engine/dist/emptyproject.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- The Wick Engine build is injected here during the engine build step (see gulpfile.js) -->
<script>
/*Wick Engine https://github.com/Wicklets/wick-engine*/
var WICK_ENGINE_BUILD_VERSION = "2020.4.10.16.11.19";
var WICK_ENGINE_BUILD_VERSION = "2020.4.15.13.19.3";
/*!
* Paper.js v0.12.4 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
Expand Down Expand Up @@ -60598,7 +60598,7 @@
} else if (this._fitMode === 'fill') {
// Fill mode: Try to fit the wick project's canvas inside the container canvas by
// scaling it as much as possible without changing the project's original aspect ratio
this.paper.view.zoom = this.model.zoom * this.calculateFitZoom() * window.devicePixelRatio;
this.paper.view.zoom = this.model.zoom * this.calculateFitZoom();
}

var pan = this._pan;
Expand Down Expand Up @@ -60706,21 +60706,21 @@
strokeColor: 'black'
}), // bottom
new paper.Path.Rectangle({
from: new paper.Point(borderMin, this.model.height * window.devicePixelRatio + strokeOffset),
from: new paper.Point(borderMin, this.model.height + strokeOffset),
to: new paper.Point(borderMax, borderMax),
fillColor: 'black',
strokeWidth: 1,
strokeColor: 'black'
}), // left
new paper.Path.Rectangle({
from: new paper.Point(borderMin, -strokeOffset),
to: new paper.Point(-strokeOffset, this.model.height * window.devicePixelRatio + strokeOffset),
to: new paper.Point(-strokeOffset, this.model.height + strokeOffset),
fillColor: 'black',
strokeWidth: 1,
strokeColor: 'black'
}), // right
new paper.Path.Rectangle({
from: new paper.Point(this.model.width * window.devicePixelRatio + strokeOffset, -strokeOffset),
from: new paper.Point(this.model.width + strokeOffset, -strokeOffset),
to: new paper.Point(borderMax, borderMax),
fillColor: 'black',
strokeWidth: 1,
Expand Down
10 changes: 5 additions & 5 deletions engine/dist/wickengine.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*Wick Engine https://github.com/Wicklets/wick-engine*/
var WICK_ENGINE_BUILD_VERSION = "2020.4.10.16.11.19";
var WICK_ENGINE_BUILD_VERSION = "2020.4.15.13.19.3";
/*!
* Paper.js v0.12.4 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
Expand Down Expand Up @@ -60583,7 +60583,7 @@ Wick.View.Project = class extends Wick.View {
} else if (this._fitMode === 'fill') {
// Fill mode: Try to fit the wick project's canvas inside the container canvas by
// scaling it as much as possible without changing the project's original aspect ratio
this.paper.view.zoom = this.model.zoom * this.calculateFitZoom() * window.devicePixelRatio;
this.paper.view.zoom = this.model.zoom * this.calculateFitZoom();
}

var pan = this._pan;
Expand Down Expand Up @@ -60691,21 +60691,21 @@ Wick.View.Project = class extends Wick.View {
strokeColor: 'black'
}), // bottom
new paper.Path.Rectangle({
from: new paper.Point(borderMin, this.model.height * window.devicePixelRatio + strokeOffset),
from: new paper.Point(borderMin, this.model.height + strokeOffset),
to: new paper.Point(borderMax, borderMax),
fillColor: 'black',
strokeWidth: 1,
strokeColor: 'black'
}), // left
new paper.Path.Rectangle({
from: new paper.Point(borderMin, -strokeOffset),
to: new paper.Point(-strokeOffset, this.model.height * window.devicePixelRatio + strokeOffset),
to: new paper.Point(-strokeOffset, this.model.height + strokeOffset),
fillColor: 'black',
strokeWidth: 1,
strokeColor: 'black'
}), // right
new paper.Path.Rectangle({
from: new paper.Point(this.model.width * window.devicePixelRatio + strokeOffset, -strokeOffset),
from: new paper.Point(this.model.width + strokeOffset, -strokeOffset),
to: new paper.Point(borderMax, borderMax),
fillColor: 'black',
strokeWidth: 1,
Expand Down
8 changes: 4 additions & 4 deletions engine/src/view/View.Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Wick.View.Project = class extends Wick.View {
} else if (this._fitMode === 'fill') {
// Fill mode: Try to fit the wick project's canvas inside the container canvas by
// scaling it as much as possible without changing the project's original aspect ratio
this.paper.view.zoom = this.model.zoom * this.calculateFitZoom() * window.devicePixelRatio;
this.paper.view.zoom = this.model.zoom * this.calculateFitZoom();
}

var pan = this._pan;
Expand Down Expand Up @@ -465,7 +465,7 @@ Wick.View.Project = class extends Wick.View {
}),
// bottom
new paper.Path.Rectangle({
from: new paper.Point(borderMin, (this.model.height*window.devicePixelRatio)+strokeOffset),
from: new paper.Point(borderMin, (this.model.height)+strokeOffset),
to: new paper.Point(borderMax, borderMax),
fillColor: 'black',
strokeWidth: 1,
Expand All @@ -474,14 +474,14 @@ Wick.View.Project = class extends Wick.View {
// left
new paper.Path.Rectangle({
from: new paper.Point(borderMin, -strokeOffset),
to: new paper.Point(-strokeOffset, (this.model.height*window.devicePixelRatio)+strokeOffset),
to: new paper.Point(-strokeOffset, (this.model.height)+strokeOffset),
fillColor: 'black',
strokeWidth: 1,
strokeColor: 'black',
}),
// right
new paper.Path.Rectangle({
from: new paper.Point((this.model.width*window.devicePixelRatio)+strokeOffset, -strokeOffset),
from: new paper.Point((this.model.width)+strokeOffset, -strokeOffset),
to: new paper.Point(borderMax, borderMax),
fillColor: 'black',
strokeWidth: 1,
Expand Down
10 changes: 5 additions & 5 deletions public/corelibs/wick-engine/emptyproject.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- The Wick Engine build is injected here during the engine build step (see gulpfile.js) -->
<script>
/*Wick Engine https://github.com/Wicklets/wick-engine*/
var WICK_ENGINE_BUILD_VERSION = "2020.4.10.16.11.19";
var WICK_ENGINE_BUILD_VERSION = "2020.4.15.13.19.3";
/*!
* Paper.js v0.12.4 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
Expand Down Expand Up @@ -60598,7 +60598,7 @@
} else if (this._fitMode === 'fill') {
// Fill mode: Try to fit the wick project's canvas inside the container canvas by
// scaling it as much as possible without changing the project's original aspect ratio
this.paper.view.zoom = this.model.zoom * this.calculateFitZoom() * window.devicePixelRatio;
this.paper.view.zoom = this.model.zoom * this.calculateFitZoom();
}

var pan = this._pan;
Expand Down Expand Up @@ -60706,21 +60706,21 @@
strokeColor: 'black'
}), // bottom
new paper.Path.Rectangle({
from: new paper.Point(borderMin, this.model.height * window.devicePixelRatio + strokeOffset),
from: new paper.Point(borderMin, this.model.height + strokeOffset),
to: new paper.Point(borderMax, borderMax),
fillColor: 'black',
strokeWidth: 1,
strokeColor: 'black'
}), // left
new paper.Path.Rectangle({
from: new paper.Point(borderMin, -strokeOffset),
to: new paper.Point(-strokeOffset, this.model.height * window.devicePixelRatio + strokeOffset),
to: new paper.Point(-strokeOffset, this.model.height + strokeOffset),
fillColor: 'black',
strokeWidth: 1,
strokeColor: 'black'
}), // right
new paper.Path.Rectangle({
from: new paper.Point(this.model.width * window.devicePixelRatio + strokeOffset, -strokeOffset),
from: new paper.Point(this.model.width + strokeOffset, -strokeOffset),
to: new paper.Point(borderMax, borderMax),
fillColor: 'black',
strokeWidth: 1,
Expand Down
10 changes: 5 additions & 5 deletions public/corelibs/wick-engine/wickengine.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*Wick Engine https://github.com/Wicklets/wick-engine*/
var WICK_ENGINE_BUILD_VERSION = "2020.4.10.16.11.19";
var WICK_ENGINE_BUILD_VERSION = "2020.4.15.13.19.3";
/*!
* Paper.js v0.12.4 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
Expand Down Expand Up @@ -60583,7 +60583,7 @@ Wick.View.Project = class extends Wick.View {
} else if (this._fitMode === 'fill') {
// Fill mode: Try to fit the wick project's canvas inside the container canvas by
// scaling it as much as possible without changing the project's original aspect ratio
this.paper.view.zoom = this.model.zoom * this.calculateFitZoom() * window.devicePixelRatio;
this.paper.view.zoom = this.model.zoom * this.calculateFitZoom();
}

var pan = this._pan;
Expand Down Expand Up @@ -60691,21 +60691,21 @@ Wick.View.Project = class extends Wick.View {
strokeColor: 'black'
}), // bottom
new paper.Path.Rectangle({
from: new paper.Point(borderMin, this.model.height * window.devicePixelRatio + strokeOffset),
from: new paper.Point(borderMin, this.model.height + strokeOffset),
to: new paper.Point(borderMax, borderMax),
fillColor: 'black',
strokeWidth: 1,
strokeColor: 'black'
}), // left
new paper.Path.Rectangle({
from: new paper.Point(borderMin, -strokeOffset),
to: new paper.Point(-strokeOffset, this.model.height * window.devicePixelRatio + strokeOffset),
to: new paper.Point(-strokeOffset, this.model.height + strokeOffset),
fillColor: 'black',
strokeWidth: 1,
strokeColor: 'black'
}), // right
new paper.Path.Rectangle({
from: new paper.Point(this.model.width * window.devicePixelRatio + strokeOffset, -strokeOffset),
from: new paper.Point(this.model.width + strokeOffset, -strokeOffset),
to: new paper.Point(borderMax, borderMax),
fillColor: 'black',
strokeWidth: 1,
Expand Down

0 comments on commit 70dc46f

Please sign in to comment.