@lvce-editor/title-bar-worker 4.20.2 → 4.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/titleBarWorkerMain.js +13 -6
- package/package.json +1 -1
|
@@ -4031,11 +4031,15 @@ const measureTextWidths2 = async (texts, fontWeight, fontSize, fontFamily, lette
|
|
|
4031
4031
|
if (typeof letterSpacing !== 'number') {
|
|
4032
4032
|
throw new TypeError('letterSpacing must be of type number');
|
|
4033
4033
|
}
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4034
|
+
const rpc = await launchTextMeasurementWorker();
|
|
4035
|
+
try {
|
|
4036
|
+
const isMonospaceFont = false;
|
|
4037
|
+
const charWidth = 0;
|
|
4038
|
+
const result = await rpc.invoke('TextMeasurement.measureTextWidths', texts, fontWeight, fontSize, fontFamily, letterSpacing, isMonospaceFont, charWidth);
|
|
4039
|
+
return result;
|
|
4040
|
+
} finally {
|
|
4041
|
+
await rpc[Symbol.asyncDispose]();
|
|
4042
|
+
}
|
|
4039
4043
|
};
|
|
4040
4044
|
|
|
4041
4045
|
const measureTextWidths = async (texts, fontWeight, fontSize, fontFamily, letterSpacing) => measureTextWidths2(texts, fontWeight, fontSize, fontFamily, letterSpacing);
|
|
@@ -5404,6 +5408,9 @@ const getNewMenus = async (menus, level, index, flags) => {
|
|
|
5404
5408
|
x,
|
|
5405
5409
|
y
|
|
5406
5410
|
} = menu;
|
|
5411
|
+
if (flags === Separator$1) {
|
|
5412
|
+
return menus;
|
|
5413
|
+
}
|
|
5407
5414
|
const item = items[index];
|
|
5408
5415
|
if (focusedIndex === index) {
|
|
5409
5416
|
if (index === -1) {
|
|
@@ -5476,7 +5483,7 @@ const handleMenuMouseOver = async (state, level, index) => {
|
|
|
5476
5483
|
if (!item) {
|
|
5477
5484
|
return state;
|
|
5478
5485
|
}
|
|
5479
|
-
const newMenus = await getNewMenus(menus, level, index);
|
|
5486
|
+
const newMenus = await getNewMenus(menus, level, index, item.flags);
|
|
5480
5487
|
if (menus === newMenus) {
|
|
5481
5488
|
return state;
|
|
5482
5489
|
}
|