From 719ad649feb91c26849b1f0bb929995de54e3c42 Mon Sep 17 00:00:00 2001 From: liabru Date: Tue, 17 Jan 2017 23:55:40 +0000 Subject: [PATCH] changed default render styles --- src/body/Body.js | 4 ++-- src/constraint/Constraint.js | 2 +- src/factory/Composites.js | 10 ++++++++-- src/render/Render.js | 7 ++++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/body/Body.js b/src/body/Body.js index 0a6672c..0e15d52 100644 --- a/src/body/Body.js +++ b/src/body/Body.js @@ -80,7 +80,7 @@ var Axes = require('../geometry/Axes'); xOffset: 0, yOffset: 0 }, - lineWidth: 1.5 + lineWidth: 0 } }; @@ -152,7 +152,7 @@ var Axes = require('../geometry/Axes'); }); // render properties - var defaultFillStyle = (body.isStatic ? '#eeeeee' : Common.choose(['#556270', '#4ECDC4', '#C7F464', '#FF6B6B', '#C44D58'])), + var defaultFillStyle = (body.isStatic ? '#2e2b44' : Common.choose(['#006BA6', '#0496FF', '#FFBC42', '#D81159', '#8F2D56'])), defaultStrokeStyle = Common.shadeColor(defaultFillStyle, -20); body.render.fillStyle = body.render.fillStyle || defaultFillStyle; body.render.strokeStyle = body.render.strokeStyle || defaultStrokeStyle; diff --git a/src/constraint/Constraint.js b/src/constraint/Constraint.js index 7795ea3..c3bbd4d 100644 --- a/src/constraint/Constraint.js +++ b/src/constraint/Constraint.js @@ -60,7 +60,7 @@ var Common = require('../core/Common'); var render = { visible: true, lineWidth: 2, - strokeStyle: '#666' + strokeStyle: '#ffffff' }; constraint.render = Common.extend(render, constraint.render); diff --git a/src/factory/Composites.js b/src/factory/Composites.js index 3bfe921..1f63cca 100644 --- a/src/factory/Composites.js +++ b/src/factory/Composites.js @@ -275,14 +275,20 @@ var Bodies = require('./Bodies'); bodyA: body, pointA: { x: wheelAOffset, y: wheelYOffset }, bodyB: wheelA, - stiffness: 0.2 + stiffness: 0.2, + render: { + lineWidth: 0 + } }); var axelB = Constraint.create({ bodyA: body, pointA: { x: wheelBOffset, y: wheelYOffset }, bodyB: wheelB, - stiffness: 0.2 + stiffness: 0.2, + render: { + lineWidth: 0 + } }); Composite.addBody(car, body); diff --git a/src/render/Render.js b/src/render/Render.js index ae1f756..85fe9c5 100644 --- a/src/render/Render.js +++ b/src/render/Render.js @@ -52,7 +52,7 @@ var Mouse = require('../core/Mouse'); width: 800, height: 600, pixelRatio: 1, - background: '#fafafa', + background: '#18181d', wireframeBackground: '#0f0f13', hasBounds: !!options.bounds, enabled: true, @@ -892,12 +892,13 @@ var Mouse = require('../core/Mouse'); if (options.wireframes) { c.strokeStyle = 'indianred'; + c.lineWidth = 1; } else { - c.strokeStyle = 'rgba(0,0,0,0.8)'; + c.strokeStyle = 'rgba(255, 255, 255, 0.4)'; c.globalCompositeOperation = 'overlay'; + c.lineWidth = 2; } - c.lineWidth = 1; c.stroke(); c.globalCompositeOperation = 'source-over'; };