2017-02-20 2 views
0

Chrome에서 작동하는 요소로 변환하려고하지만 FF로 오류가 발생합니다.SVG-globalToLocal이 FF에서 작동하지 않습니다.

var T = null; 

try { 
    T = element.getScreenCTM().inverse().multiply(root.getScreenCTM()); 

} catch (err) { 
    //TypeError: element.getScreenCTM(...) is null 
    T = element.getTransformToElement(root); 
} 

//InvalidStateError: 
//An attempt was made to use an object that is not, or is no longer, usable 

rootelement 함유의 <svg> 요소를 지칭한다.

그 원인은 무엇입니까? 어떤 도움을 주셔서 감사합니다!

+0

@RobertLongson 지금 바로 해결할 수 있습니다! 그것은 실제로'display : none' 문제였습니다. 감사! 네가 대답하면 받아 들일거야! – philipp

답변

1

계층 구조의 요소가 display : none 인 경우 Firefox는 변환을 계산하지 않습니다.