This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

✨ Object#{set_rotation,rotate}, Context#latest_marker

+25 -3
+13 -1
src/graphics/objects.rs
··· 1 - use crate::{Fill, Filter, Point, Region, Transformation}; 2 1 use std::fmt::Display; 3 2 3 + use crate::{Angle, Fill, Filter, Point, Region, Transformation}; 4 4 use itertools::Itertools; 5 5 #[cfg(feature = "web")] 6 6 use wasm_bindgen::prelude::*; ··· 101 101 102 102 pub fn filter(&mut self, filter: Filter) { 103 103 self.filters.push(filter) 104 + } 105 + 106 + pub fn rotate(&mut self, angle: Angle) { 107 + self.transformations 108 + .push(Transformation::Rotate(angle.degrees())) 109 + } 110 + 111 + pub fn set_rotation(&mut self, angle: Angle) { 112 + self.transformations 113 + .retain(|t| !matches!(t, Transformation::Rotate(_))); 114 + self.transformations 115 + .push(Transformation::Rotate(angle.degrees())) 104 116 } 105 117 106 118 pub fn region(&self) -> Region {
+12 -2
src/video/context.rs
··· 109 109 self.syncdata 110 110 .markers 111 111 .get(&self.ms) 112 - .unwrap_or(&"".to_string()) 113 - .to_string() 112 + .map(|marker| marker.to_string()) 113 + .unwrap_or_default() 114 + } 115 + 116 + pub fn latest_marker(&self) -> String { 117 + self.syncdata 118 + .markers 119 + .iter() 120 + .filter(|&(&ms, _)| ms <= self.ms) 121 + .max_by_key(|&(&ms, _)| ms) 122 + .map(|(_, marker)| marker.to_string()) 123 + .unwrap_or_default() 114 124 } 115 125 116 126 pub fn duration_ms(&self) -> usize {