Skip to content

Commit

Permalink
fix text back
Browse files Browse the repository at this point in the history
  • Loading branch information
wassfila committed Jun 8, 2024
1 parent 1a2ccdf commit 7eac690
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/panzoom/lib_svg_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ async function svg_text_focus(modal_content,svg,text,pzref){
let text_nodes = draw.find('text');
let span_nodes = draw.find('span');
let text_array = [ ...text_nodes,...span_nodes ];
let text_hits = text_array.filter(node => node.node.innerHTML == text);
let text_hits = text_array.filter(obj => obj.node.innerHTML == text);
if(text_hits.length > 0){
let targetText = text_hits[0]
if(targetText.bbox === "function"){
if(typeof targetText.bbox === "function"){
const bbox = targetText.bbox();
let box_center_x = bbox.x + bbox.width / 2;
let box_center_y = bbox.y + bbox.height / 2;
Expand Down

0 comments on commit 7eac690

Please sign in to comment.