fix(dock): size drag preview slots by the edge viewport height
The dock drag preview computed slot heights and drop indices from the full window height, but docked panel columns only span the model viewport, so the preview overlay and insertion point drifted below the actual dock edge. Use the current viewport height so the ghost and drop index line up with the panels.
This commit is contained in:
parent
9f68034a60
commit
2a0b7805c0
2 changed files with 4 additions and 2 deletions
|
|
@ -636,6 +636,7 @@ pub(super) fn on_ribbon_tool_click(&mut self, tool_id: String, event: ModuleEven
|
|||
}
|
||||
DockMsg::DragMove(point) => {
|
||||
if self.dock_dragging.is_some() {
|
||||
let avail = self.tabs[self.active_tab].scene.selection.borrow().vp_size.1;
|
||||
let side = if point.x < self.win_size.0 * 0.5 {
|
||||
DockSide::Left
|
||||
} else {
|
||||
|
|
@ -644,7 +645,7 @@ pub(super) fn on_ribbon_tool_click(&mut self, tool_id: String, event: ModuleEven
|
|||
let index = crate::ui::dock::drop_index(
|
||||
point.y,
|
||||
std::cmp::max(self.dock.len(side), 1),
|
||||
self.win_size.1,
|
||||
avail,
|
||||
);
|
||||
self.dock_drag_target = Some((side, index));
|
||||
} else if let Some(id) = self.dock_resizing {
|
||||
|
|
|
|||
Loading…
Reference in a new issue