Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/core/items/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ impl Item for TextInput {
self.set_cursor_position(
clicked_offset,
true,
if (pressed - 1) % 3 == 0 {
if (pressed - 1).is_multiple_of(3) {
TextChangeNotify::TriggerCallbacks
} else {
TextChangeNotify::SkipCallbacks
Expand Down
2 changes: 1 addition & 1 deletion internal/core/properties/properties_animations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<T: InterpolatedPropertyValue + Clone> PropertyValueAnimationData<T> {
AnimationDirection::Normal => false,
AnimationDirection::Reverse => true,
AnimationDirection::Alternate => iteration % 2 == 1,
AnimationDirection::AlternateReverse => iteration % 2 == 0,
AnimationDirection::AlternateReverse => iteration.is_multiple_of(2),
}
};

Expand Down
2 changes: 1 addition & 1 deletion internal/core/styled_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl StyledText {
}
match list_item_type {
Some(ListItemType::Unordered) => {
if indentation % 3 == 0 {
if indentation.is_multiple_of(3) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not consistent with the condition two lines bellow. But OK

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also prefer to keep it consistent. Another option would be store the remainder of the division in a variable and then use that in the if - for readability.

text.push_str("• ")
} else if indentation % 3 == 1 {
text.push_str("◦ ")
Expand Down
Loading