mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-30 15:25:47 +08:00
@@ -3,7 +3,7 @@ class BaseEmote {
|
|||||||
late String emoticonUnique;
|
late String emoticonUnique;
|
||||||
late double width;
|
late double width;
|
||||||
late double height;
|
late double height;
|
||||||
late final isUpower = emoticonUnique.startsWith('upower_');
|
late final isOfficial = emoticonUnique.startsWith('official_');
|
||||||
|
|
||||||
BaseEmote.fromJson(Map<String, dynamic> json) {
|
BaseEmote.fromJson(Map<String, dynamic> json) {
|
||||||
url = json['url'];
|
url = json['url'];
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import 'package:PiliPlus/common/widgets/flutter/popup_menu.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/gesture/tap_gesture_recognizer.dart';
|
import 'package:PiliPlus/common/widgets/gesture/tap_gesture_recognizer.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/http/live.dart';
|
import 'package:PiliPlus/http/live.dart';
|
||||||
import 'package:PiliPlus/models/common/image_type.dart';
|
|
||||||
import 'package:PiliPlus/models_new/live/live_danmaku/danmaku_msg.dart';
|
import 'package:PiliPlus/models_new/live/live_danmaku/danmaku_msg.dart';
|
||||||
import 'package:PiliPlus/models_new/live/live_superchat/item.dart';
|
import 'package:PiliPlus/models_new/live/live_superchat/item.dart';
|
||||||
import 'package:PiliPlus/pages/live_room/controller.dart';
|
import 'package:PiliPlus/pages/live_room/controller.dart';
|
||||||
@@ -241,14 +240,20 @@ class LiveRoomChatPanel extends StatelessWidget {
|
|||||||
InlineSpan _buildMsg(double devicePixelRatio, 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}}" , "upower_[{{emote}}]" , "official_{{int}}"
|
||||||
final isUpower = uemote.isUpower;
|
final double width, height;
|
||||||
|
if (uemote.isOfficial) {
|
||||||
|
width = uemote.width / devicePixelRatio;
|
||||||
|
height = uemote.height / devicePixelRatio;
|
||||||
|
} else {
|
||||||
|
width = height = 162.0 / devicePixelRatio;
|
||||||
|
}
|
||||||
return WidgetSpan(
|
return WidgetSpan(
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src: uemote.url,
|
src: uemote.url,
|
||||||
type: ImageType.emote,
|
type: .emote,
|
||||||
width: isUpower ? uemote.width : uemote.width / devicePixelRatio,
|
width: width,
|
||||||
height: isUpower ? uemote.height : uemote.height / devicePixelRatio,
|
height: height,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -265,7 +270,7 @@ class LiveRoomChatPanel extends StatelessWidget {
|
|||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src: emote.url,
|
src: emote.url,
|
||||||
type: ImageType.emote,
|
type: .emote,
|
||||||
width: emote.width,
|
width: emote.width,
|
||||||
height: emote.height,
|
height: emote.height,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user