@@ -417,6 +417,30 @@ export default class GleapMarkerManager {
417417 // Capture SVG ref
418418 const captureSVG = document . querySelector ( ".bb-capture-svg" ) ;
419419
420+ const chooseTool = function ( type , toolbarItem ) {
421+ const toolbarTools = document . querySelectorAll (
422+ ".bb-capture-toolbar-item-tool"
423+ ) ;
424+ for ( let j = 0 ; j < toolbarTools . length ; j ++ ) {
425+ toolbarTools [ j ] . classList . remove ( "bb-capture-toolbar-item--active" ) ;
426+ }
427+ toolbarItem . classList . add ( "bb-capture-toolbar-item--active" ) ;
428+ self . screenDrawer . setTool ( type ) ;
429+
430+ self . dragCursor . innerHTML = "" ;
431+ if ( type === "pointer" ) {
432+ captureSVG . style . pointerEvents = "none" ;
433+ } else {
434+ captureSVG . style . pointerEvents = "auto" ;
435+ try {
436+ var svgClone = toolbarItem . querySelector ( "svg" ) . cloneNode ( true ) ;
437+ if ( svgClone && self . dragCursor ) {
438+ self . dragCursor . appendChild ( svgClone ) ;
439+ }
440+ } catch ( exp ) { }
441+ }
442+ }
443+
420444 // Setup toolbar items
421445 var toolbarItems = document . querySelectorAll ( ".bb-capture-toolbar-item" ) ;
422446 for ( var i = 0 ; i < toolbarItems . length ; i ++ ) {
@@ -436,6 +460,7 @@ export default class GleapMarkerManager {
436460 self . screenRecorder . stopScreenRecording ( ) ;
437461 } else {
438462 self . screenRecorder . startScreenRecording ( ) ;
463+ chooseTool ( type , document . querySelector ( ".bb-capture-toolbar-item[data-type='pointer']" ) ) ;
439464 }
440465 }
441466
@@ -450,27 +475,7 @@ export default class GleapMarkerManager {
450475 type === "rect" ||
451476 type === "pointer"
452477 ) {
453- const toolbarTools = document . querySelectorAll (
454- ".bb-capture-toolbar-item-tool"
455- ) ;
456- for ( let j = 0 ; j < toolbarTools . length ; j ++ ) {
457- toolbarTools [ j ] . classList . remove ( "bb-capture-toolbar-item--active" ) ;
458- }
459- toolbarItem . classList . add ( "bb-capture-toolbar-item--active" ) ;
460- self . screenDrawer . setTool ( type ) ;
461-
462- self . dragCursor . innerHTML = "" ;
463- if ( type === "pointer" ) {
464- captureSVG . style . pointerEvents = "none" ;
465- } else {
466- captureSVG . style . pointerEvents = "auto" ;
467- try {
468- var svgClone = toolbarItem . querySelector ( "svg" ) . cloneNode ( true ) ;
469- if ( svgClone && self . dragCursor ) {
470- self . dragCursor . appendChild ( svgClone ) ;
471- }
472- } catch ( exp ) { }
473- }
478+ chooseTool ( type , toolbarItem ) ;
474479 }
475480 if ( type === "colorpicker" ) {
476481 if ( colorpicker . style . display === "flex" ) {
0 commit comments