Pārlūkot izejas kodu

ViewHelper: Optimize resolution of canvas texture.

Mugen87 5 gadi atpakaļ
vecāks
revīzija
dd6cd1f37c
1 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 5 5
      editor/js/Viewport.ViewHelper.js

+ 5 - 5
editor/js/Viewport.ViewHelper.js

@@ -102,22 +102,22 @@ function ViewHelper() {
 	function generateTexture( color, text = null ) {
 	function generateTexture( color, text = null ) {
 
 
 		var canvas = document.createElement( 'canvas' );
 		var canvas = document.createElement( 'canvas' );
-		canvas.width = 128;
-		canvas.height = 128;
+		canvas.width = 64;
+		canvas.height = 64;
 
 
 		var context = canvas.getContext( '2d' );
 		var context = canvas.getContext( '2d' );
 		context.beginPath();
 		context.beginPath();
-		context.arc( 64, 64, 32, 0, 2 * Math.PI );
+		context.arc( 32, 32, 16, 0, 2 * Math.PI );
 		context.closePath();
 		context.closePath();
 		context.fillStyle = color;
 		context.fillStyle = color;
 		context.fill();
 		context.fill();
 
 
 		if ( text !== null ) {
 		if ( text !== null ) {
 
 
-			context.font = '48px Arial';
+			context.font = '24px Arial';
 			context.textAlign = 'center';
 			context.textAlign = 'center';
 			context.fillStyle = '#000000';
 			context.fillStyle = '#000000';
-			context.fillText( text, 64, 84 );
+			context.fillText( text, 32, 41 );
 
 
 		}
 		}