The grab band hangs on the line the eye sees
Browse files at this commitb413bc5a43fe8c96beccbbac64a6affe0167502dParent: cebb935- style
- the grab band hangs on the line the eye sees
2 changed files +9 -5
crates/app/src/interact.rsmodified+5 -3
| @@ -248,7 +248,9 @@ pub(crate) fn drag_scrim(cx: &mut Context<Player>) -> Div { | ||
| 248 | 248 | /// first move -- so the lit line has to come from the model, not from `hover`. |
| 249 | 249 | /// |
| 250 | 250 | /// What the *hand* aims at is wider than what the eye is given: the press and |
| 251 | -/// the resize cursor live on a [`GRAB_W`] band centred on the strip, mounted | |
| 251 | +/// the resize cursor live on a [`GRAB_W`] band centred on the *line the eye | |
| 252 | +/// sees* -- one row above the strip, so it reaches past the panel edge the | |
| 253 | +/// strip stands in front of rather than being centred on the strip -- mounted | |
| 252 | 254 | /// absolutely so it overlays its neighbours instead of pushing them (the strip |
| 253 | 255 | /// keeps its [`SPLIT_W`] of layout, and `layout::split_drag_size` keeps |
| 254 | 256 | /// answering in strip coordinates). A 6 px target missed by 5 px is a resize |
| @@ -285,14 +287,14 @@ pub(crate) fn divider(split: Split, held: bool, cx: &mut Context<Player>) -> Div | ||
| 285 | 287 | .when(across, |d| { |
| 286 | 288 | d.left_0() |
| 287 | 289 | .right_0() |
| 288 | - .top(px((SPLIT_W - GRAB_W) / 2.)) | |
| 290 | + .top(px(-1.)) | |
| 289 | 291 | .h(px(GRAB_W)) |
| 290 | 292 | .cursor_row_resize() |
| 291 | 293 | }) |
| 292 | 294 | .when(!across, |d| { |
| 293 | 295 | d.top_0() |
| 294 | 296 | .bottom_0() |
| 295 | - .left(px((SPLIT_W - GRAB_W) / 2.)) | |
| 297 | + .left(px(-1.)) | |
| 296 | 298 | .w(px(GRAB_W)) |
| 297 | 299 | .cursor_col_resize() |
| 298 | 300 | }) |
crates/app/src/layout.rsmodified+4 -2
| @@ -295,8 +295,10 @@ pub(crate) const SPLIT_W: f32 = 6.; | ||
| 295 | 295 | /// have -- the lead's own press one row into the bench missed the seam by 5 px |
| 296 | 296 | /// and focused the bench instead ("panes should be enlargable and shrinkable", |
| 297 | 297 | /// of panes that already resized). 12 px is the ±6 px of aim every editor's |
| 298 | -/// dividers allow. | |
| 299 | -pub(crate) const GRAB_W: f32 = 12.; | |
| 298 | +/// dividers allow, and it is hung one row above the strip rather than centred | |
| 299 | +/// on it: what a hand aims at is the line it can see (the panel's own edge at | |
| 300 | +/// the strip's far side), not the six transparent pixels in front of it. | |
| 301 | +pub(crate) const GRAB_W: f32 = 14.; | |
| 300 | 302 | |
| 301 | 303 | /// The most of the window one side column may be dragged to. A third each, so |
| 302 | 304 | /// the picture keeps the middle at every size -- the rule [`library_w`] and |