@hanology/cham-browser 0.4.48 → 0.4.49
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/package.json
CHANGED
|
@@ -160,22 +160,27 @@ export function useAnnotationTooltip() {
|
|
|
160
160
|
bottom: '0',
|
|
161
161
|
}
|
|
162
162
|
} else if (layout.value === 'vertical') {
|
|
163
|
-
// Vertical mode:
|
|
164
|
-
const
|
|
163
|
+
// Vertical mode: card next to hovered text
|
|
164
|
+
const maxW = 260
|
|
165
165
|
const cardH = Math.min(vh - 16, 480)
|
|
166
166
|
const gap = 12
|
|
167
|
-
let left = Math.max(8, rect.left -
|
|
167
|
+
let left = Math.max(8, rect.left - maxW - gap)
|
|
168
168
|
let top = Math.max(8, Math.min(rect.top, vh - cardH))
|
|
169
169
|
|
|
170
170
|
// If not enough room on left, go right
|
|
171
|
-
if (
|
|
172
|
-
left =
|
|
171
|
+
if (left < 8) {
|
|
172
|
+
left = rect.right + gap
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Clamp to viewport
|
|
176
|
+
if (left + maxW > vw - 8) {
|
|
177
|
+
left = Math.max(8, vw - maxW - 8)
|
|
173
178
|
}
|
|
174
179
|
|
|
175
180
|
style.value = {
|
|
176
181
|
left: left + 'px',
|
|
177
182
|
top: top + 'px',
|
|
178
|
-
|
|
183
|
+
maxWidth: maxW + 'px',
|
|
179
184
|
maxHeight: cardH + 'px',
|
|
180
185
|
}
|
|
181
186
|
} else {
|