From 668dadc39ea4c359d8b73fe9ddeec6a067367ebd Mon Sep 17 00:00:00 2001 From: henryjin0511 <443836568@qq.com> Date: Fri, 10 Nov 2023 18:31:05 +0800 Subject: [PATCH] feat(voltron): voltron_renderer adapt unit test --- renderer/voltron/lib/render/manager.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/renderer/voltron/lib/render/manager.dart b/renderer/voltron/lib/render/manager.dart index da42f6302cf..7fbbd4e802f 100644 --- a/renderer/voltron/lib/render/manager.dart +++ b/renderer/voltron/lib/render/manager.dart @@ -279,6 +279,8 @@ class RenderManager double correctPixel(double len) { var density = ScreenUtil.getInstance().scale; + // 兼容测试用例 + density = density <= 0 ? 1.0 : density; return (len * density).roundToDouble() / density; }