| 5884 | |
| 5885 | // Set default background behavior for 2D and 3D contexts |
| 5886 | var refreshBackground = function() { |
| 5887 | if (curSketch.options.isOpaque) { |
| 5888 | if (p.use3DContext) { |
| 5889 | // fill background default opaque gray |
| 5890 | curContext.clearColor(204 / 255, 204 / 255, 204 / 255, 1.0); |
| 5891 | curContext.clear(curContext.COLOR_BUFFER_BIT | curContext.DEPTH_BUFFER_BIT); |
| 5892 | } else { |
| 5893 | // fill background default opaque gray |
| 5894 | curContext.fillStyle = "rgb(204, 204, 204)"; |
| 5895 | curContext.fillRect(0, 0, p.width, p.height); |
| 5896 | isFillDirty = true; |
| 5897 | } |
| 5898 | } |
| 5899 | }; |
| 5900 | |
| 5901 | // Changes the size of the Canvas ( this resets context properties like 'lineCap', etc. |
| 5902 | p.size = function size(aWidth, aHeight, aMode) { |