Skip to content

Commit

Permalink
Simplify GlyphInfo.var2 access.
Browse files Browse the repository at this point in the history
  • Loading branch information
RazrFalcon committed Sep 9, 2023
1 parent 11d0c1e commit 5b78158
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/complex/arabic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,11 @@ pub enum JoiningType {

impl GlyphInfo {
fn arabic_shaping_action(&self) -> u8 {
let v: &[u8; 4] = bytemuck::cast_ref(&self.var2);
v[2]
self.complex_var_u8_auxiliary()
}

fn set_arabic_shaping_action(&mut self, action: u8) {
let v: &mut [u8; 4] = bytemuck::cast_mut(&mut self.var2);
v[2] = action;
self.set_complex_var_u8_auxiliary(action)
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/complex/hangul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ const TJMO: u8 = 3;

impl GlyphInfo {
fn hangul_shaping_feature(&self) -> u8 {
let v: &[u8; 4] = bytemuck::cast_ref(&self.var2);
v[2]
self.complex_var_u8_auxiliary()
}

fn set_hangul_shaping_feature(&mut self, feature: u8) {
let v: &mut [u8; 4] = bytemuck::cast_mut(&mut self.var2);
v[2] = feature;
self.set_complex_var_u8_auxiliary(feature)
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,7 @@ fn insert_dotted_circle(buffer: &mut Buffer, face: &Face) {
glyph_id: 0x25CC,
mask: buffer.cur(0).mask,
cluster: buffer.cur(0).cluster,
var1: 0,
var2: 0,
..GlyphInfo::default()
};

info.init_unicode_props(&mut buffer.scratch_flags);
Expand Down

0 comments on commit 5b78158

Please sign in to comment.