revert #956 - restore smoothing in the paint editor

dev
Jens Mönig 2015-10-02 13:32:34 +02:00
rodzic ee19e66ea9
commit cada9be942
2 zmienionych plików z 1 dodań i 18 usunięć

Wyświetl plik

@ -2585,4 +2585,3 @@ ______
* GUI, Blocks, BYOB: New “Export Project Summary” Feature, also: exporting script pics now includes attached comments
* Blocks, Objects, Threads: Key hat block and key sensor support for “any” key
* German translation update
* Suppress antialiasing when scaling things in the paint editor. Thanks, Kartik!

Wyświetl plik

@ -58,6 +58,7 @@
Aug 24 - floodfill alpha-integer issue (Kartik)
Sep 29 - tweaks (Jens)
Sep 28 [of the following year :)] - Try to prevent antialiasing (Kartik)
Oct 02 - revert disable smoothing (Jens)
*/
/*global Point, Rectangle, DialogBoxMorph, fontHeight, AlignmentMorph,
@ -596,7 +597,6 @@ PaintCanvasMorph.prototype.scale = function (x, y) {
this.rotationCenter.y
);
c.getContext("2d").scale(1 + x, 1 + y);
this.disableSmoothing(c.getContext("2d"));
c.getContext("2d").drawImage(
this.paper,
-this.rotationCenter.x,
@ -624,24 +624,11 @@ PaintCanvasMorph.prototype.undo = function () {
}
};
PaintCanvasMorph.prototype.disableSmoothing = function (ctx) {
ctx.imageSmoothingEnabled = false; /* standard */
// we oughta keep checking whether the following ones
// are still needed
ctx.mozImageSmoothingEnabled = false; /* Firefox */
ctx.oImageSmoothingEnabled = false; /* Opera */
ctx.webkitImageSmoothingEnabled = false; /* Safari */
ctx.msImageSmoothingEnabled = false; /* IE */
};
PaintCanvasMorph.prototype.merge = function (a, b) {
this.disableSmoothing(b.getContext("2d"));
b.getContext("2d").drawImage(a, 0, 0);
};
PaintCanvasMorph.prototype.centermerge = function (a, b) {
this.disableSmoothing(b.getContext("2d"));
b.getContext("2d").drawImage(
a,
(b.width - a.width) / 2,
@ -829,9 +816,6 @@ PaintCanvasMorph.prototype.mouseMove = function (pos) {
mctx.lineWidth = this.settings.linewidth;
mctx.clearRect(0, 0, this.bounds.width(), this.bounds.height()); // mask
// Antialiasing trick.
mctx.translate(0.5, 0.5);
this.dragRect.corner = relpos.subtract(this.dragRect.origin); // reset crn
if (this.settings.primarycolor === "transparent" &&