mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
fix: font size
This commit is contained in:
@@ -68,7 +68,8 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
|||||||
@override
|
@override
|
||||||
void didUpdateWidget(PlDanmaku oldWidget) {
|
void didUpdateWidget(PlDanmaku oldWidget) {
|
||||||
super.didUpdateWidget(oldWidget);
|
super.didUpdateWidget(oldWidget);
|
||||||
if (oldWidget.notFullscreen != widget.notFullscreen) {
|
if (oldWidget.notFullscreen != widget.notFullscreen &&
|
||||||
|
!DanmakuOptions.sameFontScale) {
|
||||||
_controller?.updateOption(
|
_controller?.updateOption(
|
||||||
DanmakuOptions.get(notFullscreen: widget.notFullscreen),
|
DanmakuOptions.get(notFullscreen: widget.notFullscreen),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -995,7 +995,8 @@ class _LiveDanmakuState extends State<LiveDanmaku> {
|
|||||||
@override
|
@override
|
||||||
void didUpdateWidget(LiveDanmaku oldWidget) {
|
void didUpdateWidget(LiveDanmaku oldWidget) {
|
||||||
super.didUpdateWidget(oldWidget);
|
super.didUpdateWidget(oldWidget);
|
||||||
if (oldWidget.notFullscreen != widget.notFullscreen) {
|
if (oldWidget.notFullscreen != widget.notFullscreen &&
|
||||||
|
!DanmakuOptions.sameFontScale) {
|
||||||
plPlayerController.danmakuController?.updateOption(
|
plPlayerController.danmakuController?.updateOption(
|
||||||
DanmakuOptions.get(notFullscreen: widget.notFullscreen),
|
DanmakuOptions.get(notFullscreen: widget.notFullscreen),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -19,12 +19,14 @@ abstract final class DanmakuOptions {
|
|||||||
static bool massiveMode = Pref.danmakuMassiveMode;
|
static bool massiveMode = Pref.danmakuMassiveMode;
|
||||||
static double danmakuLineHeight = Pref.danmakuLineHeight;
|
static double danmakuLineHeight = Pref.danmakuLineHeight;
|
||||||
|
|
||||||
|
static bool sameFontScale = danmakuFontScale == danmakuFontScaleFS;
|
||||||
|
|
||||||
static DanmakuOption get({
|
static DanmakuOption get({
|
||||||
required bool notFullscreen,
|
required bool notFullscreen,
|
||||||
double speed = 1.0,
|
double speed = 1.0,
|
||||||
}) {
|
}) {
|
||||||
return DanmakuOption(
|
return DanmakuOption(
|
||||||
fontSize: notFullscreen ? danmakuFontScaleFS : danmakuFontScale,
|
fontSize: 15 * (notFullscreen ? danmakuFontScaleFS : danmakuFontScale),
|
||||||
fontWeight: danmakuFontWeight,
|
fontWeight: danmakuFontWeight,
|
||||||
area: danmakuShowArea,
|
area: danmakuShowArea,
|
||||||
duration: danmakuDuration / speed,
|
duration: danmakuDuration / speed,
|
||||||
|
|||||||
Reference in New Issue
Block a user