mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-22 07:08:42 -06:00
add pixel_perfect
feature, document stuff
This commit is contained in:
parent
e3c4be7fdc
commit
250e821396
|
@ -23,9 +23,15 @@ fontdue = "0.8"
|
||||||
rect_packer = "0.2"
|
rect_packer = "0.2"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
nz = "0.3"
|
nz = "0.3"
|
||||||
|
document-features = "0.2"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["builtin_elements", "builtin_font"]
|
default = ["builtin_elements", "builtin_font", "pixel_perfect"]
|
||||||
|
## Enable the built-in font (ProggyTiny, adds 35kb to the executable)
|
||||||
builtin_font = []
|
builtin_font = []
|
||||||
|
## Enable the built-in elements (`Container`, `ProgressBar`, etc.)
|
||||||
builtin_elements = []
|
builtin_elements = []
|
||||||
|
## Round vertex positions to nearest integer coordinates (fixes blurry text)
|
||||||
|
pixel_perfect = []
|
||||||
|
|
||||||
#parallel = ["dep:rayon", "fontdue/parallel"]
|
#parallel = ["dep:rayon", "fontdue/parallel"]
|
||||||
|
|
|
@ -317,6 +317,10 @@ impl UiDrawPlan {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[cfg(feature = "pixel_perfect")]
|
||||||
|
swapper.current_mut().vertices.iter_mut().for_each(|v| {
|
||||||
|
v.position = v.position.floor()
|
||||||
|
});
|
||||||
prev_command = Some(command);
|
prev_command = Some(command);
|
||||||
}
|
}
|
||||||
Self {
|
Self {
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
#![forbid(unsafe_code)]
|
|
||||||
#![forbid(unsafe_op_in_unsafe_fn)]
|
|
||||||
#![doc(html_logo_url = "https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/hui.svg")]
|
#![doc(html_logo_url = "https://raw.githubusercontent.com/griffi-gh/hui/master/.assets/hui.svg")]
|
||||||
//!
|
//!
|
||||||
//! Simple UI library for games and other interactive applications
|
//! Simple UI library for games and other interactive applications
|
||||||
//!
|
//!
|
||||||
|
//! # Features
|
||||||
|
#![doc = document_features::document_features!()]
|
||||||
|
|
||||||
|
#![forbid(unsafe_code)]
|
||||||
|
#![forbid(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue