kopia lustrzana https://github.com/backface/turtlestitch
fixed symbols extent
rodzic
7195a00c74
commit
e492817349
|
@ -2570,11 +2570,11 @@ Rectangle.prototype.setTo = function (left, top, right, bottom) {
|
|||
// Rectangle mutating
|
||||
|
||||
Rectangle.prototype.setWidth = function (width) {
|
||||
this.corner.x += width;
|
||||
this.corner.x = this.origin.x + width;
|
||||
};
|
||||
|
||||
Rectangle.prototype.setHeight = function (height) {
|
||||
this.corner.y += height;
|
||||
this.corner.y = this.origin.y + height;
|
||||
};
|
||||
|
||||
// Rectangle accessing - getting:
|
||||
|
|
|
@ -49,14 +49,19 @@ var SymbolMorph;
|
|||
WorldMorph.prototype.customMorphs = function () {
|
||||
// add examples to the world's demo menu
|
||||
return [
|
||||
new SymbolMorph(
|
||||
'globe',
|
||||
50,
|
||||
new Color(250, 250, 250),
|
||||
new Point(-1, -1),
|
||||
new Color(20, 20, 20)
|
||||
)
|
||||
];
|
||||
'camera',
|
||||
'location',
|
||||
'footprints',
|
||||
'keyboard',
|
||||
'keyboardFilled',
|
||||
'globe'
|
||||
].map(sym => new SymbolMorph(
|
||||
sym,
|
||||
50,
|
||||
new Color(250, 250, 250),
|
||||
new Point(-1, -1),
|
||||
new Color(20, 20, 20)
|
||||
));
|
||||
};
|
||||
*/
|
||||
|
||||
|
@ -191,11 +196,11 @@ SymbolMorph.prototype.fixLayout = function () {
|
|||
};
|
||||
|
||||
SymbolMorph.prototype.render = function (ctx) {
|
||||
var x, y, sx, sy;
|
||||
sx = this.shadowOffset.x < 0 ? 0 : this.shadowOffset.x;
|
||||
sy = this.shadowOffset.y < 0 ? 0 : this.shadowOffset.y;
|
||||
x = this.shadowOffset.x < 0 ? Math.abs(this.shadowOffset.x) : 0;
|
||||
y = this.shadowOffset.y < 0 ? Math.abs(this.shadowOffset.y) : 0;
|
||||
var sx = this.shadowOffset.x < 0 ? 0 : this.shadowOffset.x,
|
||||
sy = this.shadowOffset.y < 0 ? 0 : this.shadowOffset.y,
|
||||
x = this.shadowOffset.x < 0 ? Math.abs(this.shadowOffset.x) : 0,
|
||||
y = this.shadowOffset.y < 0 ? Math.abs(this.shadowOffset.y) : 0;
|
||||
|
||||
if (this.shadowColor) {
|
||||
ctx.save();
|
||||
ctx.translate(sx, sy);
|
||||
|
|
Ładowanie…
Reference in New Issue