Commit 5b16ae67 authored by rockyl's avatar rockyl

作用dpr

parent 2588c85c
...@@ -60,15 +60,15 @@ export function parseDom(el: HTMLElement = document.body) { ...@@ -60,15 +60,15 @@ export function parseDom(el: HTMLElement = document.body) {
break; break;
} }
if(!bound && childNode.getBoundingClientRect){ if (!bound && childNode.getBoundingClientRect) {
bound = childNode.getBoundingClientRect(); bound = childNode.getBoundingClientRect();
} }
let styles = getStylesWithoutDefaults(node || childNode); let styles = getStylesWithoutDefaults(node || childNode);
if (!isText) { if (!isText) {
for(let skey of commonStyleKeys){ for (let skey of commonStyleKeys) {
if(commonStyleKeys.indexOf(skey) < 0){ if (commonStyleKeys.indexOf(skey) < 0) {
continue continue
} }
......
This diff is collapsed.
...@@ -40,10 +40,11 @@ ...@@ -40,10 +40,11 @@
<img class="avatar" src="//yun.duiba.com.cn/aurora/14e3d0fa0e1ff54553a2c8c094b1caffd90f0a43.png"/> <img class="avatar" src="//yun.duiba.com.cn/aurora/14e3d0fa0e1ff54553a2c8c094b1caffd90f0a43.png"/>
<canvas id="canvas" style="position: absolute; left: 10px; top: 10px;"></canvas> <canvas id="canvas" style="position: absolute; left: 10px; top: 10px;"></canvas>
<p class="ppp"> <p class="ppp">
a<br/>bcde<span style="background-color: rgba(0,255,0,0.5);">span</span>fghij a<br/>bcdefghij
</p> </p>
</div> </div>
<!--
<span style="background-color: rgba(0,255,0,0.5);">span</span>-->
<script> <script>
let canvas = document.getElementById('canvas'); let canvas = document.getElementById('canvas');
let context = canvas.getContext('2d'); let context = canvas.getContext('2d');
......
...@@ -36,6 +36,7 @@ interface INodeData { ...@@ -36,6 +36,7 @@ interface INodeData {
fontStyle?: "normal" | "italic" | "oblique"; fontStyle?: "normal" | "italic" | "oblique";
} }
export interface RenderOptions { export interface RenderOptions {
scale?: number;
type?: 'canvas' | 'jpeg' | 'png'; type?: 'canvas' | 'jpeg' | 'png';
quality?: number; quality?: number;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment