28
28
unused_mut
29
29
) ]
30
30
31
+ use euclid:: point2;
32
+
31
33
use crate :: DisplayExt ;
32
34
use std:: ffi:: { CStr , CString } ;
33
35
use std:: ptr;
@@ -40,7 +42,7 @@ use super::dpx_fontmap::pdf_lookup_fontmap_record;
40
42
use super :: dpx_mem:: new;
41
43
use super :: dpx_pdfcolor:: PdfColor ;
42
44
use super :: dpx_pdfdev:: {
43
- dev_unit_dviunit, graphics_mode, Coord , pdf_dev_get_dirmode, pdf_dev_get_font_wmode,
45
+ dev_unit_dviunit, graphics_mode, Point , pdf_dev_get_dirmode, pdf_dev_get_font_wmode,
44
46
pdf_dev_get_param, pdf_dev_locate_font, pdf_dev_put_image, pdf_dev_set_dirmode,
45
47
pdf_dev_set_param, pdf_dev_set_string, Rect , TMatrix , transform_info,
46
48
transform_info_clear,
@@ -289,18 +291,16 @@ pub unsafe fn mps_scan_bbox(
289
291
} else {
290
292
/* The new xetex.def and dvipdfmx.def require bbox->llx = bbox->lly = 0. */
291
293
if translate_origin != 0 {
292
- bbox. ll = Coord :: zero ( ) ;
293
- bbox. ur . x = values[ 2 ] - values[ 0 ] ;
294
- bbox. ur . y = values[ 3 ] - values[ 1 ] ;
294
+ * bbox = Rect :: new ( Point :: zero ( ) , point2 ( values[ 2 ] - values[ 0 ] , values[ 3 ] - values[ 1 ] ) ) ;
295
295
Xorigin = values[ 0 ] ;
296
- Yorigin = values[ 1 ]
296
+ Yorigin = values[ 1 ] ;
297
297
} else {
298
- bbox. ll . x = values [ 0 ] ;
299
- bbox . ll . y = values[ 1 ] ;
300
- bbox . ur . x = values[ 2 ] ;
301
- bbox . ur . y = values [ 3 ] ;
302
- Xorigin = 0.0f64 ;
303
- Yorigin = 0.0f64
298
+ * bbox = Rect :: new (
299
+ point2 ( values[ 0 ] , values [ 1 ] ) ,
300
+ point2 ( values[ 2 ] , values [ 3 ] ) ,
301
+ ) ;
302
+ Xorigin = 0. ;
303
+ Yorigin = 0.
304
304
}
305
305
return 0i32 ;
306
306
}
@@ -615,7 +615,7 @@ unsafe fn do_currentfont() -> i32 {
615
615
error
616
616
}
617
617
unsafe fn do_show ( ) -> i32 {
618
- let mut cp = Coord :: zero ( ) ;
618
+ let mut cp = Point :: zero ( ) ;
619
619
let font = if currentfont < 0i32 {
620
620
ptr:: null_mut ( )
621
621
} else {
@@ -718,10 +718,10 @@ unsafe fn do_texfig_operator(mut opcode: Opcode, mut x_user: f64, mut y_user: f6
718
718
let dvi2pts = 1.0f64 / dev_unit_dviunit ( ) ;
719
719
fig_p. width = values[ 0 ] * dvi2pts;
720
720
fig_p. height = values[ 1 ] * dvi2pts;
721
- fig_p. bbox . ll . x = values[ 2 ] * dvi2pts;
722
- fig_p. bbox . ll . y = -values[ 3 ] * dvi2pts;
723
- fig_p. bbox . ur . x = values[ 4 ] * dvi2pts;
724
- fig_p. bbox . ur . y = -values[ 5 ] * dvi2pts;
721
+ fig_p. bbox . min . x = values[ 2 ] * dvi2pts;
722
+ fig_p. bbox . min . y = -values[ 3 ] * dvi2pts;
723
+ fig_p. bbox . max . x = values[ 4 ] * dvi2pts;
724
+ fig_p. bbox . max . y = -values[ 5 ] * dvi2pts;
725
725
fig_p. flags |= 1i32 << 0i32 ;
726
726
sprintf (
727
727
resname. as_mut_ptr ( ) ,
@@ -730,8 +730,8 @@ unsafe fn do_texfig_operator(mut opcode: Opcode, mut x_user: f64, mut y_user: f6
730
730
) ;
731
731
xobj_id = pdf_doc_begin_grabbing (
732
732
resname. as_mut_ptr ( ) ,
733
- fig_p. bbox . ll . x ,
734
- fig_p. bbox . ur . y ,
733
+ fig_p. bbox . min . x ,
734
+ fig_p. bbox . max . y ,
735
735
& mut fig_p. bbox ,
736
736
) ;
737
737
in_tfig = 1i32 ;
@@ -767,7 +767,7 @@ unsafe fn ps_dev_CTM() -> TMatrix {
767
767
unsafe fn do_operator ( token : & [ u8 ] , mut x_user : f64 , mut y_user : f64 ) -> i32 {
768
768
let mut error: i32 = 0i32 ;
769
769
let mut tmp = None ;
770
- let mut cp = Coord :: zero ( ) ;
770
+ let mut cp = Point :: zero ( ) ;
771
771
let opcode = get_opcode ( token) ;
772
772
if opcode. is_err ( ) {
773
773
if is_fontname ( token) {
0 commit comments