Skip to content

Commit

Permalink
fix chars with width > 1
Browse files Browse the repository at this point in the history
  • Loading branch information
TornaxO7 committed Jan 17, 2024
1 parent a3cdf09 commit cafe7df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sugarloaf/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Text {
let quantity = if decoration.is_some() || media.is_some() {
1
} else {
let mut counter = 1;
let mut quantity = 1;

while iterator
.next_if(|next_sugar| {
Expand All @@ -65,10 +65,10 @@ impl Text {
})
.is_some()
{
counter += 1;
quantity += 1;
}

counter
quantity
};

Self {
Expand Down
2 changes: 1 addition & 1 deletion sugarloaf/src/sugarloaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ impl Sugarloaf {

{
let rect_builder = RectBuilder {
sugarwidth: self.layout.sugarwidth * 2., // "* 2." because we want some space to the left and right which sums up to one sugarwidth
sugarwidth: self.layout.scaled_sugarwidth * 2., // "* 2." because we want some space to the left and right which sums up to one sugarwidth
sugarheight: self.layout.sugarheight,
line_height: self.layout.line_height,
scale: self.ctx.scale,
Expand Down

0 comments on commit cafe7df

Please sign in to comment.