Skip to content

Commit 9ecad32

Browse files
authored
fix(QMenu,QTooltip): use round instead of floor for positioning quasarframework#6673 (quasarframework#7238)
1 parent b6fab30 commit 9ecad32

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ui/src/utils/position-engine.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,19 @@ export function setPosition (cfg) {
137137
applyBoundaries(props, anchorProps, targetProps, cfg.anchorOrigin, cfg.selfOrigin)
138138

139139
elStyle = {
140-
top: Math.floor(props.top) + 'px',
141-
left: Math.floor(props.left) + 'px'
140+
top: Math.round(props.top) + 'px',
141+
left: Math.round(props.left) + 'px'
142142
}
143143

144144
if (props.maxHeight !== void 0) {
145-
elStyle.maxHeight = Math.floor(props.maxHeight) + 'px'
145+
elStyle.maxHeight = Math.round(props.maxHeight) + 'px'
146146

147147
if (anchorProps.height > props.maxHeight) {
148148
elStyle.minHeight = elStyle.maxHeight
149149
}
150150
}
151151
if (props.maxWidth !== void 0) {
152-
elStyle.maxWidth = Math.floor(props.maxWidth) + 'px'
152+
elStyle.maxWidth = Math.round(props.maxWidth) + 'px'
153153

154154
if (anchorProps.width > props.maxWidth) {
155155
elStyle.minWidth = elStyle.maxWidth

0 commit comments

Comments
 (0)