Fix backgroundColor option documentation (Fix #1164)

This commit is contained in:
Niklas von Hertzen 2017-12-12 21:23:53 +08:00
parent 77d258f1d8
commit 3965a0fd40
4 changed files with 5 additions and 4 deletions

View File

@ -13,7 +13,7 @@ These are all of the available configuration options.
| ------------- | :------: | ----------- |
| async | `true` | Whether to parse and render the element asynchronously
| allowTaint | `false` | Whether to allow cross-origin images to taint the canvas
| backgroundColor | `#ffffff` | Canvas background color, if none is specified in DOM. Set undefined for transparent
| backgroundColor | `#ffffff` | Canvas background color, if none is specified in DOM. Set `null` for transparent
| canvas | `null` | Existing `canvas` element to use as a base for drawing on
| foreignObjectRendering | `false` | Whether to use ForeignObject rendering if the browser supports it
| imageTimeout | `15000` | Timeout for loading an image (in milliseconds). Set to `0` to disable timeout.

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "html2canvas",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -353,8 +353,8 @@ export default class Renderer {
render(stack: StackingContext): Promise<*> {
if (this.options.backgroundColor) {
this.target.rectangle(
0,
0,
this.options.x,
this.options.y,
this.options.width,
this.options.height,
this.options.backgroundColor

View File

@ -64,6 +64,7 @@ const html2canvas = (element: HTMLElement, conf: ?Options): Promise<*> => {
const defaultOptions = {
async: true,
allowTaint: false,
backgroundColor: '#ffffff',
imageTimeout: 15000,
logging: true,
proxy: null,