From 9fdba127bf25c8cf05c6d34c2327f186c3c3434c Mon Sep 17 00:00:00 2001
From: MoyuScript <i@moyu.moe>
Date: Tue, 12 Dec 2017 21:23:53 +0800
Subject: [PATCH] Fix backgroundColor option documentation (Fix #1164)

---
 docs/configuration.md | 2 +-
 package-lock.json     | 2 +-
 src/Renderer.js       | 4 ++--
 src/index.js          | 1 +
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/docs/configuration.md b/docs/configuration.md
index 0862495..7d95362 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -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.
diff --git a/package-lock.json b/package-lock.json
index 231ba2a..535fe27 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "html2canvas",
-  "version": "1.0.0-alpha.1",
+  "version": "1.0.0-alpha.4",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
diff --git a/src/Renderer.js b/src/Renderer.js
index 3e59702..322d066 100644
--- a/src/Renderer.js
+++ b/src/Renderer.js
@@ -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
diff --git a/src/index.js b/src/index.js
index a61b6c5..19058f1 100644
--- a/src/index.js
+++ b/src/index.js
@@ -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,