Skip to content

Commit

Permalink
Merge pull request #196 from crlf0710/bugfix
Browse files Browse the repository at this point in the history
Fix part of #195.
  • Loading branch information
crlf0710 authored Nov 18, 2019
2 parents f55d0f6 + 0ba4b44 commit c5463f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions dpx/src/dpx_pdfdraw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,23 @@ impl TMatrix {

impl Coord {
pub fn transform(&mut self, M: &TMatrix) -> Result<(), ()> {
self.x = self.x * M.a + self.y * M.c + M.e;
self.y = self.x * M.b + self.y * M.d + M.f;
let (x, y) = (self.x, self.y);
self.x = x * M.a + y * M.c + M.e;
self.y = x * M.b + y * M.d + M.f;
Ok(())
}
pub fn dtransform(&mut self, M: &TMatrix) -> Result<(), ()> {
self.x = self.x * M.a + self.y * M.c;
self.y = self.x * M.b + self.y * M.d;
let (x, y) = (self.x, self.y);
self.x = x * M.a + y * M.c;
self.y = x * M.b + y * M.d;
Ok(())
}

fn idtransform(&mut self, M: &TMatrix) -> Result<(), ()> {
let W = M.inverse()?;
self.x = self.x * W.a + self.y * W.c;
self.y = self.x * W.b + self.y * W.d;
let (x, y) = (self.x, self.y);
self.x = x * W.a + y * W.c;
self.y = x * W.b + y * W.d;
Ok(())
}
}
Expand Down
2 changes: 1 addition & 1 deletion dpx/src/specials/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub unsafe extern "C" fn spc_misc_setup_handler(
let key = (*args).cur;
let mut keylen = 0;
for &c in (*args).cur {
if (c as u8).is_ascii_alphabetic() {
if !(c as u8).is_ascii_alphabetic() {
break;
}
keylen += 1;
Expand Down

0 comments on commit c5463f0

Please sign in to comment.