File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
packages/roosterjs-content-model-dom/lib/modelApi/editing Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -276,10 +276,13 @@ function mergeValue<K extends keyof ContentModelFormatState>(
276276}
277277
278278function px2Pt ( px : string ) {
279- if ( px && px . indexOf ( 'px' ) == px . length - 2 ) {
280- // Edge may not handle the floating computing well which causes the calculated value is a little less than actual value
281- // So add 0.05 to fix it
282- return Math . round ( parseFloat ( px ) * 75 + 0.05 ) / 100 + 'pt' ;
279+ if ( px ) {
280+ const index = px . indexOf ( 'px' ) ;
281+ if ( index !== - 1 && index === px . length - 2 ) {
282+ // Edge may not handle the floating computing well which causes the calculated value to be a little less than the actual value
283+ // So add 0.05 to fix it
284+ return Math . round ( parseFloat ( px ) * 75 + 0.05 ) / 100 + 'pt' ;
285+ }
283286 }
284287 return px ;
285- }
288+ }
You can’t perform that action at this time.
0 commit comments