示例#1
0
float SVGLayoutSupport::calculateScreenFontSizeScalingFactor(
    const LayoutObject* layoutObject) {
  ASSERT(layoutObject);

  // FIXME: trying to compute a device space transform at record time is wrong.
  // All clients should be updated to avoid relying on this information, and the
  // method should be removed.
  AffineTransform ctm =
      deprecatedCalculateTransformToLayer(layoutObject) *
      SubtreeContentTransformScope::currentContentTransformation();
  ctm.scale(
      layoutObject->document().frameHost()->deviceScaleFactorDeprecated());

  return clampTo<float>(sqrt((ctm.xScaleSquared() + ctm.yScaleSquared()) / 2));
}