|
@@ -522,33 +522,27 @@ THREE.CanvasRenderer = function ( parameters ) {
|
|
|
|
|
|
setFillStyle( pattern.canvas );
|
|
setFillStyle( pattern.canvas );
|
|
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
- setFillStyle( 'rgba( 0, 0, 0, 1 )' );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //
|
|
|
|
|
|
+ var bitmap = texture.image;
|
|
|
|
|
|
- var bitmap = texture.image;
|
|
|
|
|
|
+ var ox = bitmap.width * texture.offset.x;
|
|
|
|
+ var oy = bitmap.height * texture.offset.y;
|
|
|
|
|
|
- var ox = bitmap.width * texture.offset.x;
|
|
|
|
- var oy = bitmap.height * texture.offset.y;
|
|
|
|
|
|
+ var sx = bitmap.width * texture.repeat.x;
|
|
|
|
+ var sy = bitmap.height * texture.repeat.y;
|
|
|
|
|
|
- var sx = bitmap.width * texture.repeat.x;
|
|
|
|
- var sy = bitmap.height * texture.repeat.y;
|
|
|
|
|
|
+ var cx = scaleX / sx;
|
|
|
|
+ var cy = scaleY / sy;
|
|
|
|
|
|
- var cx = scaleX / sx;
|
|
|
|
- var cy = scaleY / sy;
|
|
|
|
|
|
+ _context.save();
|
|
|
|
+ _context.translate( v1.x, v1.y );
|
|
|
|
+ if ( material.rotation !== 0 ) _context.rotate( material.rotation );
|
|
|
|
+ _context.translate( - scaleX / 2, - scaleY / 2 );
|
|
|
|
+ _context.scale( cx, cy );
|
|
|
|
+ _context.translate( - ox, - oy );
|
|
|
|
+ _context.fillRect( ox, oy, sx, sy );
|
|
|
|
+ _context.restore();
|
|
|
|
|
|
- _context.save();
|
|
|
|
- _context.translate( v1.x, v1.y );
|
|
|
|
- if ( material.rotation !== 0 ) _context.rotate( material.rotation );
|
|
|
|
- _context.translate( - scaleX / 2, - scaleY / 2 );
|
|
|
|
- _context.scale( cx, cy );
|
|
|
|
- _context.translate( - ox, - oy );
|
|
|
|
- _context.fillRect( ox, oy, sx, sy );
|
|
|
|
- _context.restore();
|
|
|
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|