Skip to content

Commit

Permalink
hotfix number of projects
Browse files Browse the repository at this point in the history
  • Loading branch information
bertiqwerty committed Dec 18, 2024
1 parent 6321c59 commit 5abade7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rvimage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "rvimage"
license = "MIT OR Apache-2.0"
description = "A remote image viewer with a labeling tool"
readme = "../README.md"
version = "0.4.21"
version = "0.4.22"
homepage = "https://github.com/bertiqwerty/rvimage"
repository = "https://github.com/bertiqwerty/rvimage"
keywords = ["image", "viewer", "label", "remote", "ssh"]
Expand Down
2 changes: 1 addition & 1 deletion rvimage/src/rvlib/menu/annotations_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ macro_rules! tdm_instance_annos {
}
));
$ui.end_row();
for p in &parents[0..$max_n_folders] {
for p in &parents[0..$max_n_folders.min(parents.len())] {
let p_label = egui::RichText::new(
p.to_str()
.map(|p| if p.is_empty() { $cpp_parent } else { p })
Expand Down
22 changes: 11 additions & 11 deletions rvimage/src/rvlib/tools/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
events::Events,
history::History,
world,
world::{DataAccess, World},
world::{MetaDataAccess, World},
};
use rvimage_domain::PtF;
use std::mem;
Expand Down Expand Up @@ -102,7 +102,7 @@ pub(super) fn change_annos<T, DA, IA>(
f_change: impl FnOnce(&mut InstanceAnnotations<T>),
) where
T: InstanceAnnotate,
DA: DataAccess,
DA: MetaDataAccess,
IA: InstanceAnnoAccess<T>,
{
if let Some(annos) = IA::get_annos_mut(world) {
Expand All @@ -121,7 +121,7 @@ pub(super) fn change_annos<T, DA, IA>(
}
pub(super) fn check_trigger_redraw<DC>(mut world: World, name: &'static str) -> World
where
DC: DataAccess,
DC: MetaDataAccess,
{
let core_options = DC::get_core_options(&world).copied();
let is_redraw_triggered = core_options.map(|o| o.is_redraw_annos_triggered);
Expand All @@ -145,7 +145,7 @@ pub(super) fn check_trigger_history_update<DC>(
name: &'static str,
) -> (World, History)
where
DC: DataAccess,
DC: MetaDataAccess,
{
let core_options = DC::get_core_options_mut(&mut world).copied();
let is_history_update_triggered = core_options.map(|o| o.is_history_update_triggered);
Expand Down Expand Up @@ -234,7 +234,7 @@ fn replace_annotations_with_clipboard<T, DA, IA>(
) -> (World, History)
where
T: InstanceAnnotate,
DA: DataAccess,
DA: MetaDataAccess,
IA: InstanceAnnoAccess<T>,
{
let annos = IA::get_annos_mut(&mut world);
Expand All @@ -251,7 +251,7 @@ pub(super) fn check_autopaste<T, DA, IA>(
) -> (World, History)
where
T: InstanceAnnotate,
DA: DataAccess,
DA: MetaDataAccess,
IA: InstanceAnnoAccess<T>,
{
let clipboard_data = IA::get_clipboard(&world).cloned();
Expand All @@ -274,7 +274,7 @@ pub fn check_erase_mode<AC>(
mut world: World,
) -> World
where
AC: DataAccess,
AC: MetaDataAccess,
{
if let (ReleasedKey::E, Some(core_options)) =
(released_key, AC::get_core_options_mut(&mut world))
Expand All @@ -293,7 +293,7 @@ where

pub fn check_recolorboxes<AC>(mut world: World, actor: &'static str) -> World
where
AC: DataAccess,
AC: MetaDataAccess,
{
let is_colorchange_triggered =
AC::get_core_options_mut(&mut world).map(|o| o.is_colorchange_triggered);
Expand Down Expand Up @@ -352,7 +352,7 @@ pub(super) fn paste<T, DA, IA>(
) -> (World, History)
where
T: InstanceAnnotate,
DA: DataAccess,
DA: MetaDataAccess,
IA: InstanceAnnoAccess<T>,
{
if let Some(clipboard) = clipboard {
Expand Down Expand Up @@ -383,7 +383,7 @@ where
pub fn deselect_all<T, DA, IA>(mut world: World, actor: &'static str) -> World
where
T: InstanceAnnotate,
DA: DataAccess,
DA: MetaDataAccess,
IA: InstanceAnnoAccess<T>,
{
// Deselect all
Expand All @@ -404,7 +404,7 @@ pub(super) fn on_selection_keys<T, DA, IA>(
) -> (World, History)
where
T: InstanceAnnotate,
DA: DataAccess,
DA: MetaDataAccess,
IA: InstanceAnnoAccess<T>,
{
match key {
Expand Down
4 changes: 2 additions & 2 deletions rvimage/src/rvlib/tools/instance_anno_shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
meta_data::MetaData,
result::trace_ok_err,
tools_data::{merge, ExportAsCoco, ImportMode, Rot90ToolData},
world::{self, DataAccess, World},
world::{self, MetaDataAccess, World},
InstanceAnnotate,
};
use std::mem;
Expand All @@ -24,7 +24,7 @@ pub fn check_cocoimport<T, A, DA>(
where
T: ExportAsCoco<A> + Default,
A: InstanceAnnotate + 'static,
DA: DataAccess,
DA: MetaDataAccess,
{
enum IsImportTriggered {
Yes,
Expand Down
4 changes: 2 additions & 2 deletions rvimage/src/rvlib/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn get_specific_mut<T>(
}

/// Often needed meta data when accessing annotations, see different `AnnoMetaAccessors` structs.
pub trait DataAccess {
pub trait MetaDataAccess {
fn get_core_options(world: &World) -> Option<&tools_data::Options>;
fn get_core_options_mut(world: &mut World) -> Option<&mut tools_data::Options>;
fn get_track_changes_str(world: &World) -> Option<&'static str>;
Expand Down Expand Up @@ -106,7 +106,7 @@ macro_rules! tools_data_accessors_objects {

/// when you access annotations, you often also need this metadata
pub(super) struct DataAccessors;
impl $crate::world::DataAccess for DataAccessors {
impl $crate::world::MetaDataAccess for DataAccessors {
fn get_core_options(world: &World) -> Option<&$crate::tools_data::Options> {
get_options(world).map(|o| &o.core)
}
Expand Down

0 comments on commit 5abade7

Please sign in to comment.