Rename a length's abs component to px
`dp` is coming, and then `abs` says which of the two it is not. The component has always been a pixel count, so the name that admits it is the one that leaves room for a second unit beside it. Mechanical: the field on `Len` and `UiScalar`, their constructors, `to_abs`/`get_abs`, the matching WGSL struct member and the locals composing it. Field order and types are unchanged, so the `Pod` layout the shader reads is the same bytes. `f32::abs` is untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3f7cd8251b
commit
7c50a3e51b
22 files changed
+120
-124
No files matched your search
@@ -260,9 +260,9 @@ impl<'a> Painter<'a> {
|
||||
let mut region = origin;
|
||||
region.x.end = region.x.start;
|
||||
region.y.end = region.y.start;
|
||||
let mut region = region.offset(UiVec2::abs(glyph.offset));
|
||||
region.x.end = region.x.start + UiScalar::abs(glyph.entry.width as f32);
|
||||
region.y.end = region.y.start + UiScalar::abs(glyph.entry.height as f32);
|
||||
let mut region = region.offset(UiVec2::px(glyph.offset));
|
||||
region.x.end = region.x.start + UiScalar::px(glyph.entry.width as f32);
|
||||
region.y.end = region.y.start + UiScalar::px(glyph.entry.height as f32);
|
||||
self.write(
|
||||
kind,
|
||||
GlyphPrimitive {
|
||||
@@ -306,7 +306,7 @@ impl<'a> Painter<'a> {
|
||||
self.reads_output = [true; 2];
|
||||
self.size_box_inputs = [true; 2];
|
||||
let region = self.state.moves.resolve(self.move_idx, self.region);
|
||||
region.size().to_abs(self.state.output_size)
|
||||
region.size().to_px(self.state.output_size)
|
||||
}
|
||||
|
||||
/// One axis of this widget's box in pixels. Prefer this to
|
||||
@@ -318,7 +318,7 @@ impl<'a> Painter<'a> {
|
||||
region
|
||||
.size()
|
||||
.axis(axis)
|
||||
.to_abs(self.state.output_size.axis(axis))
|
||||
.to_px(self.state.output_size.axis(axis))
|
||||
}
|
||||
|
||||
pub fn text_data(&mut self) -> &mut TextData {
|
||||
|
||||
Reference in new issue
Block a user