mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 03:18:06 +08:00
Fix several bugs causing warning spam in the console (#4547)
This commit is contained in:
@@ -174,7 +174,8 @@ async fn request_persistence() {
|
||||
match storage.persist() {
|
||||
Ok(promise) => match JsFuture::from(promise).await {
|
||||
Ok(value) if value.as_bool() == Some(true) => {}
|
||||
Ok(_) => log::warn!("OPFS persistence was not granted; browser may evict resources under storage pressure"),
|
||||
// Browsers deny this by default unless the site is bookmarked, installed, or highly engaged, so it isn't worth a warning
|
||||
Ok(_) => log::trace!("OPFS persistence was not granted; browser may evict resources under storage pressure"),
|
||||
Err(error) => log::warn!("OPFS persist() rejected: {error:?}"),
|
||||
},
|
||||
Err(error) => log::warn!("OPFS persist() threw: {error:?}"),
|
||||
|
||||
@@ -7,6 +7,7 @@ pub mod basic_brush;
|
||||
|
||||
pub use brush_types::*;
|
||||
|
||||
// Fallbacks for stroke items carrying no such attribute, mirroring the `Brush Strokes` defaults below (which the node macro requires as literals)
|
||||
pub(crate) const DEFAULT_DIAMETER: f64 = 40.;
|
||||
pub(crate) const DEFAULT_HARDNESS: f64 = 0.;
|
||||
pub(crate) const DEFAULT_FLOW: f64 = 100.;
|
||||
@@ -17,9 +18,9 @@ fn brush_strokes(
|
||||
_: impl Ctx,
|
||||
strokes: List<Stroke>,
|
||||
color: List<Color>,
|
||||
#[default(DEFAULT_DIAMETER)] diameter: Item<f64>,
|
||||
#[default(DEFAULT_HARDNESS)] hardness: Item<Percentage>,
|
||||
#[default(DEFAULT_FLOW)] flow: Item<Percentage>,
|
||||
#[default(40.)] diameter: Item<f64>,
|
||||
#[default(0.)] hardness: Item<Percentage>,
|
||||
#[default(100.)] flow: Item<Percentage>,
|
||||
) -> List<Graphic> {
|
||||
let (diameter, hardness, flow) = (diameter.into_element(), hardness.into_element(), flow.into_element());
|
||||
List::new_from_item(
|
||||
|
||||
Reference in New Issue
Block a user