mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-20 07:15:02 +08:00
fix: 长度计算
This commit is contained in:
1 parent
a735676535
commit
32aaf98fa6
3 files changed
+26
-1
No files matched your search
@@ -154,7 +154,7 @@ import { Danmaku } from '@/core/main/custom/danmaku';
|
||||
import { GameUi } from '@/core/main/custom/ui';
|
||||
import { sleep } from 'mutate-animate';
|
||||
import { fixedUi } from '@/core/main/init/ui';
|
||||
import { tip } from '@/plugin/utils';
|
||||
import { calStringSize, tip } from '@/plugin/utils';
|
||||
import { gameKey } from '@/core/main/init/hotkey';
|
||||
import { isNil } from 'lodash-es';
|
||||
import { stringifyCSS, parseCss, getIconHeight } from '@/plugin/utils';
|
||||
@@ -294,6 +294,11 @@ function close() {
|
||||
}
|
||||
|
||||
function input(value: string) {
|
||||
const size = calStringSize(value);
|
||||
if (size > 200) {
|
||||
tip('warning', '弹幕长度超限!');
|
||||
return;
|
||||
}
|
||||
danmaku.text = value;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user