Browse Source

Fix physics example

tentone 5 years ago
parent
commit
4366bcf62d
2 changed files with 3 additions and 3 deletions
  1. 1 1
      build/escher.js
  2. 2 2
      examples/physics.html

+ 1 - 1
build/escher.js

@@ -1,7 +1,7 @@
 (function (global, factory) {
 	typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
 	typeof define === 'function' && define.amd ? define(['exports'], factory) :
-	(global = global || self, factory(global.Escher = {}));
+	(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Escher = {}));
 }(this, (function (exports) { 'use strict';
 
 	/**

+ 2 - 2
examples/physics.html

@@ -44,7 +44,7 @@
 			Escher.Circle.call(this);
 
 			this.strokeStyle = null;
-			this.fillStyle = Math.random() > 0.5 ? "#00FF00" : "#0000FF";
+			this.fillStyle = Math.random() > 0.5 ? new Escher.ColorStyle("#00FF00") : new Escher.ColorStyle("#0000FF");
 
 			this.radius = 1.0;
 
@@ -85,7 +85,7 @@
 
 		var plane = new Escher.Box();
 		plane.strokeStyle = null;
-		plane.fillStyle = "#556677";
+		plane.fillStyle = new Escher.ColorStyle("#556677");
 		plane.onPointerLeave = null;
 		plane.onPointerEnter = null;
 		plane.box.min.set(-1000, 0);