mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 09:08:11 +00:00
Merge pull request #3506 from dotCooCoo/fix/test-kit-unused-items
ui-contract: gate the suite trials' Layer re-export and lookup count on suite
This commit is contained in:
@@ -60,7 +60,7 @@ pub use state_layer::{StateLayer, StateLayerKind};
|
||||
pub(crate) use surface::{Frames as SurfaceFrames, SurfaceSlot, fit_to_frame};
|
||||
pub use surface::{Surface, frame_surfaces};
|
||||
pub use surround::paint_surround;
|
||||
#[cfg(feature = "testing")]
|
||||
#[cfg(feature = "suite")]
|
||||
pub(crate) use svg_set::Layer;
|
||||
pub use svg_set::{AppIcons, register_app_icons};
|
||||
pub use text::{ChordText, HAlign, LayoutRun, LeastLayout, ReadingMeasure, Span, TextLayout, TextRun, Wrap};
|
||||
|
||||
@@ -254,7 +254,7 @@ pub(crate) struct Shapes {
|
||||
#[cfg(feature = "testing")]
|
||||
resolutions: u32,
|
||||
/// The `made_by_component` lookups the running pass made, for the count trials.
|
||||
#[cfg(feature = "testing")]
|
||||
#[cfg(feature = "suite")]
|
||||
made_lookups: u32,
|
||||
}
|
||||
|
||||
@@ -388,6 +388,9 @@ pub(crate) fn begin(ctx: &Context, hit: HitSizes, latched: craft_keymap::Mods) {
|
||||
#[cfg(feature = "testing")]
|
||||
{
|
||||
shapes.resolutions = 0;
|
||||
}
|
||||
#[cfg(feature = "suite")]
|
||||
{
|
||||
shapes.made_lookups = 0;
|
||||
}
|
||||
});
|
||||
@@ -858,7 +861,7 @@ pub(crate) fn registered_widgets(ctx: &Context) -> std::collections::HashSet<Id>
|
||||
/// editor part, in the running pass of `viewport`.
|
||||
pub(crate) fn made_by_component(ctx: &Context, viewport: ViewportId, id: Id) -> bool {
|
||||
PerViewport::<Shapes>::with(ctx, viewport, |record| {
|
||||
#[cfg(feature = "testing")]
|
||||
#[cfg(feature = "suite")]
|
||||
{
|
||||
record.made_lookups += 1;
|
||||
}
|
||||
@@ -867,7 +870,7 @@ pub(crate) fn made_by_component(ctx: &Context, viewport: ViewportId, id: Id) ->
|
||||
}
|
||||
|
||||
/// How many `made_by_component` lookups the running pass of `viewport` made so far, for the count trials.
|
||||
#[cfg(feature = "testing")]
|
||||
#[cfg(feature = "suite")]
|
||||
pub(crate) fn made_lookups(ctx: &Context, viewport: ViewportId) -> u32 {
|
||||
PerViewport::<Shapes>::with(ctx, viewport, |record| record.made_lookups)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user