Another project
0

Configure Feed

Select the types of activity you want to include in your feed.

fmt

Lewis: May this revision serve well! <lu5a@proton.me>

author
Lewis
date (May 17, 2026, 10:10 PM +0300) commit 8cbe6569 parent 3f6e4e52 change-id ytxwqtzr
+34 -43
+3 -7
crates/bone-render/src/pick.rs
··· 487 487 .filter_map(|(row, col)| { 488 488 let offset = (row as usize) * bpr + (col as usize) * bpp; 489 489 let bytes = raw.get(offset..offset + bpp)?; 490 - let pid = PickId::from_raw(u32::from_le_bytes([ 491 - bytes[0], bytes[1], bytes[2], bytes[3], 492 - ])); 490 + let pid = 491 + PickId::from_raw(u32::from_le_bytes([bytes[0], bytes[1], bytes[2], bytes[3]])); 493 492 Some((origin_x + col as i32, origin_y + row as i32, pid)) 494 493 }) 495 494 .collect() ··· 500 499 reason = "query coords fit i32 (display pixels)" 501 500 )] 502 501 #[must_use] 503 - pub(crate) fn nearest_pick( 504 - query: PickQuery, 505 - candidates: &[(i32, i32, PickId)], 506 - ) -> Option<PickId> { 502 + pub(crate) fn nearest_pick(query: PickQuery, candidates: &[(i32, i32, PickId)]) -> Option<PickId> { 507 503 let qx = query.x.value() as i32; 508 504 let qy = query.y.value() as i32; 509 505 candidates
+1 -2
crates/bone-render/tests/picker.rs
··· 260 260 clippy::cast_sign_loss, 261 261 reason = "stroke half-width is small and bounded; ceil keeps offset positive" 262 262 )] 263 - let stroke_clearance_px = 264 - (style.strokes().stroke_width_px() * 0.5 + 1.0).ceil() as u32; 263 + let stroke_clearance_px = (style.strokes().stroke_width_px() * 0.5 + 1.0).ceil() as u32; 265 264 let off_axis = PickQuery::new( 266 265 ViewportPx::new(line_centroid.x().value() + stroke_clearance_px), 267 266 line_centroid.y(),
+1 -5
crates/bone-ui/src/text/raster/mask.rs
··· 270 270 }); 271 271 } 272 272 273 - fn atlas_entry( 274 - params: MaskAtlasParams, 275 - placed: PlacedTile, 276 - tile: &GlyphTile, 277 - ) -> MaskAtlasEntry { 273 + fn atlas_entry(params: MaskAtlasParams, placed: PlacedTile, tile: &GlyphTile) -> MaskAtlasEntry { 278 274 #[allow(clippy::cast_precision_loss, reason = "extent fits f32 mantissa")] 279 275 let extent = params.atlas_extent as f32; 280 276 #[allow(clippy::cast_precision_loss, reason = "placed coords fit f32 mantissa")]
+4 -12
crates/bone-ui/src/widgets/menu.rs
··· 747 747 )); 748 748 } 749 749 let mut popover_paint = Vec::new(); 750 - let activated = open_menu_bar_dropdown( 751 - ctx, 752 - entries, 753 - &entry_layouts, 754 - state, 755 - &mut popover_paint, 756 - ); 750 + let activated = open_menu_bar_dropdown(ctx, entries, &entry_layouts, state, &mut popover_paint); 757 751 MenuBarResponse { 758 752 activated, 759 753 paint, ··· 895 889 .min(bar_rect.size.width.value()) 896 890 .max(0.0); 897 891 let trailing_x = bar_max_x - trailing_width; 898 - let entries_end = entry_layouts 899 - .last() 900 - .map_or(bar_rect.origin.x.value(), |r| { 901 - r.origin.x.value() + r.size.width.value() 902 - }); 892 + let entries_end = entry_layouts.last().map_or(bar_rect.origin.x.value(), |r| { 893 + r.origin.x.value() + r.size.width.value() 894 + }); 903 895 let anchored_x = trailing_x.max(entries_end); 904 896 let trailing_rect = LayoutRect::new( 905 897 LayoutPos::new(LayoutPx::saturating(anchored_x), bar_rect.origin.y),
+6 -11
crates/bone-ui/src/widgets/ribbon.rs
··· 126 126 group_gap, 127 127 group_padding, 128 128 } = ribbon; 129 - let body_height = LayoutPx::saturating_nonneg(rect.size.height.value() - tab_strip_height.value()); 130 - let body_rect = LayoutRect::new( 131 - rect.origin, 132 - LayoutSize::new(rect.size.width, body_height), 133 - ); 129 + let body_height = 130 + LayoutPx::saturating_nonneg(rect.size.height.value() - tab_strip_height.value()); 131 + let body_rect = LayoutRect::new(rect.origin, LayoutSize::new(rect.size.width, body_height)); 134 132 let strip_rect = LayoutRect::new( 135 133 LayoutPos::new( 136 134 rect.origin.x, ··· 627 625 [press(click_pos), release(click_pos), idle(click_pos)] 628 626 .into_iter() 629 627 .for_each(|mut snap| { 630 - let (response, next) = 631 - render(&tabs, tabs[0].id, &mut focus, &mut snap, &prev); 628 + let (response, next) = render(&tabs, tabs[0].id, &mut focus, &mut snap, &prev); 632 629 last = Some(response); 633 630 prev = next; 634 631 }); ··· 648 645 [press(click_pos), release(click_pos), idle(click_pos)] 649 646 .into_iter() 650 647 .for_each(|mut snap| { 651 - let (response, next) = 652 - render(&tabs, tabs[0].id, &mut focus, &mut snap, &prev); 648 + let (response, next) = render(&tabs, tabs[0].id, &mut focus, &mut snap, &prev); 653 649 last = Some(response); 654 650 prev = next; 655 651 }); ··· 681 677 [press(close_pos), release(close_pos), idle(close_pos)] 682 678 .into_iter() 683 679 .for_each(|mut snap| { 684 - let (response, next) = 685 - render(&tabs, tabs[0].id, &mut focus, &mut snap, &prev); 680 + let (response, next) = render(&tabs, tabs[0].id, &mut focus, &mut snap, &prev); 686 681 last = Some(response); 687 682 prev = next; 688 683 });
+19 -6
crates/bone-ui/src/widgets/tabs.rs
··· 126 126 let mut paint = Vec::new(); 127 127 let folded = items 128 128 .iter() 129 - .map(|tab| draw_tab(ctx, tabs_id, tab, tab.id == active && active_present, orientation)) 129 + .map(|tab| { 130 + draw_tab( 131 + ctx, 132 + tabs_id, 133 + tab, 134 + tab.id == active && active_present, 135 + orientation, 136 + ) 137 + }) 130 138 .fold( 131 139 (None::<WidgetId>, None::<WidgetId>), 132 140 |(activated, closed), per_tab| { ··· 184 192 } 185 193 let live_focused = ctx.is_focused(tab.id); 186 194 let mut paint = Vec::new(); 187 - paint.extend(tab_surface_paint(ctx, tab.rect, is_active, interaction, orientation)); 195 + paint.extend(tab_surface_paint( 196 + ctx, 197 + tab.rect, 198 + is_active, 199 + interaction, 200 + orientation, 201 + )); 188 202 let label_color = tab_label_color(ctx, is_active, tab.disabled); 189 203 if let Some(glyph) = tab.glyph { 190 204 paint.push(WidgetPaint::Mark { ··· 327 341 ), 328 342 LayoutSize::new(rect.size.width, thickness), 329 343 ), 330 - TabsOrientation::Bottom => LayoutRect::new( 331 - rect.origin, 332 - LayoutSize::new(rect.size.width, thickness), 333 - ), 344 + TabsOrientation::Bottom => { 345 + LayoutRect::new(rect.origin, LayoutSize::new(rect.size.width, thickness)) 346 + } 334 347 TabsOrientation::Side => LayoutRect::new( 335 348 LayoutPos::new( 336 349 LayoutPx::new(rect.origin.x.value() + rect.size.width.value() - thickness.value()),