Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-29 14:33:54 +08:00
parent 6741333367
commit e72203afdb

View File

@@ -28,6 +28,7 @@ class LiveRoomChat extends StatelessWidget {
late final nameColor = isPP late final nameColor = isPP
? Colors.white.withValues(alpha: 0.9) ? Colors.white.withValues(alpha: 0.9)
: Colors.white.withValues(alpha: 0.6); : Colors.white.withValues(alpha: 0.6);
late final devicePixelRatio = MediaQuery.devicePixelRatioOf(context);
return Stack( return Stack(
children: [ children: [
Obx( Obx(
@@ -69,7 +70,7 @@ class LiveRoomChat extends StatelessWidget {
} }
}, },
), ),
_buildMsg(item), _buildMsg(devicePixelRatio, item),
], ],
), ),
), ),
@@ -100,7 +101,7 @@ class LiveRoomChat extends StatelessWidget {
); );
} }
InlineSpan _buildMsg(DanmakuMsg obj) { InlineSpan _buildMsg(double devicePixelRatio, DanmakuMsg obj) {
final uemote = obj.uemote; final uemote = obj.uemote;
if (uemote != null) { if (uemote != null) {
// "room_{{room_id}}_{{int}}" or "upower_[{{emote}}]" // "room_{{room_id}}_{{int}}" or "upower_[{{emote}}]"
@@ -108,8 +109,10 @@ class LiveRoomChat extends StatelessWidget {
child: NetworkImgLayer( child: NetworkImgLayer(
src: uemote.url, src: uemote.url,
type: ImageType.emote, type: ImageType.emote,
width: uemote.width, width: uemote.width / devicePixelRatio,
height: uemote.height, height: uemote.height == null
? null
: uemote.height! / devicePixelRatio,
semanticsLabel: obj.text, semanticsLabel: obj.text,
), ),
); );