File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -346,20 +346,10 @@ const deepClone = (host) => {
346
346
tagName == "IMG" ||
347
347
tagName == "SVG"
348
348
) {
349
- var height = 0 ;
350
- if ( node . style . boxSizing === "border-box" ) {
351
- height =
352
- node . height +
353
- node . marginTop +
354
- node . marginBottom +
355
- node . bordorTop +
356
- node . borderBottom ;
357
- } else {
358
- height = node . height ;
359
- }
360
-
349
+ const boundingRect = node . getBoundingClientRect ( ) ;
361
350
clone . setAttribute ( "bb-element" , true ) ;
362
- clone . setAttribute ( "bb-height" , height ) ;
351
+ clone . setAttribute ( "bb-height" , boundingRect . height ) ;
352
+ clone . setAttribute ( "bb-width" , boundingRect . width ) ;
363
353
}
364
354
365
355
if ( tagName == "DIV" && ( node . scrollTop > 0 || node . scrollLeft > 0 ) ) {
@@ -463,7 +453,7 @@ const prepareScreenshotData = (remote) => {
463
453
const bbElems = clone . querySelectorAll ( "[bb-element=true]" ) ;
464
454
for ( var i = 0 ; i < bbElems . length ; ++ i ) {
465
455
if ( bbElems [ i ] ) {
466
- bbElems [ i ] . style . height = bbElems [ i ] . getAttribute ( "bb-height" ) ;
456
+ bbElems [ i ] . style . height = bbElems [ i ] . getAttribute ( "bb-height" ) + "px" ;
467
457
}
468
458
}
469
459
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export class ScreenDrawer {
5
5
strPath ;
6
6
strokeWidth = 12 ;
7
7
strokeWidthRect = 6 ;
8
- bufferSize = 8 ;
8
+ bufferSize = 4 ;
9
9
buffer = [ ] ;
10
10
startPoint = null ;
11
11
tool = "pen" ;
You can’t perform that action at this time.
0 commit comments