Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Sep 1, 2024
1 parent e52db71 commit 08f9107
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions sugarloaf/src/components/rich_text/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
// Eventually the file had updates to support other features like background-color,
// text color, underline color and etc.

use crate::Graphics;
use crate::sugarloaf::graphics::GraphicRenderRequest;
use crate::components::rich_text::batch::BatchManager;
pub use crate::components::rich_text::batch::{DisplayList, Rect, Vertex};
use crate::components::rich_text::image_cache::glyph::{GlyphCacheSession, GlyphEntry};
pub use crate::components::rich_text::image_cache::{AddImage, ImageId, ImageLocation};
use crate::components::rich_text::image_cache::{ImageCache, ImageData};
use crate::components::rich_text::text::*;
use crate::layout::{FragmentStyleDecoration, Line, SugarDimensions, UnderlineShape};
use crate::sugarloaf::graphics::GraphicRenderRequest;
use crate::Graphics;
use crate::SugarCursor;
use crate::{Graphic, GraphicData, GraphicId};
use rustc_hash::FxHashMap;
Expand Down
4 changes: 2 additions & 2 deletions sugarloaf/src/components/rich_text/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ mod image_cache;
pub mod text;
pub mod util;

use crate::sugarloaf::graphics::GraphicRenderRequest;
use crate::Graphics;
use crate::components::core::orthographic_projection;
use crate::components::rich_text::image_cache::{GlyphCache, ImageCache, ImageId};
use crate::context::Context;
use crate::font::FontLibraryData;
use crate::layout::SugarDimensions;
use crate::sugarloaf::graphics::GraphicRenderRequest;
use crate::Graphics;
use crate::{GraphicData, GraphicId};
use compositor::{CachedRun, Compositor, DisplayList, Rect, Vertex};
use rustc_hash::FxHashMap;
Expand Down
16 changes: 7 additions & 9 deletions sugarloaf/src/sugarloaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::components::rich_text::RichTextBrush;
use crate::components::text;
use crate::font::{fonts::SugarloafFont, FontLibrary};
use crate::layout::SugarloafLayout;
use crate::sugarloaf::graphics::{GraphicData, GraphicId, Graphics, BottomLayer};
use crate::sugarloaf::graphics::{BottomLayer, GraphicData, GraphicId, Graphics};
use crate::sugarloaf::layer::types;
use crate::{context::Context, Content, Object};
use ab_glyph::{self, PxScale};
Expand Down Expand Up @@ -199,7 +199,7 @@ impl Sugarloaf<'_> {
x: image.x,
y: image.y,
},
}
},
});
self
}
Expand Down Expand Up @@ -290,11 +290,8 @@ impl Sugarloaf<'_> {
.create_view(&wgpu::TextureViewDescriptor::default());

if let Some(layer) = &self.graphics.bottom_layer {
self.layer_brush.prepare(
&mut encoder,
&mut self.ctx,
&[&layer.data],
);
self.layer_brush
.prepare(&mut encoder, &mut self.ctx, &[&layer.data]);
}

if self.graphics.has_graphics_on_top_layer() {
Expand Down Expand Up @@ -351,8 +348,9 @@ impl Sugarloaf<'_> {
self.text_brush.render(&mut self.ctx, &mut rpass);
}

if self.graphics.bottom_layer.is_some()
|| self.graphics.has_graphics_on_top_layer() {
if self.graphics.bottom_layer.is_some()
|| self.graphics.has_graphics_on_top_layer()
{
self.layer_brush.end_frame();
self.graphics.clear_top_layer();
}
Expand Down
2 changes: 1 addition & 1 deletion sugarloaf/src/sugarloaf/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

use crate::Graphics;
use super::compositors::SugarCompositors;
use crate::font::FontLibrary;
use crate::sugarloaf::{text, RectBrush, RichTextBrush, SugarloafLayout};
use crate::Graphics;
use crate::{Content, Object};

#[derive(Debug, PartialEq)]
Expand Down

0 comments on commit 08f9107

Please sign in to comment.