@@ -553,25 +553,51 @@ Q\n";
553
553
AcroForm . Appearance . internal . getWidth ( formObject ) / 4 : AcroForm . Appearance . internal . getHeight ( formObject ) / 4 ;
554
554
// The Borderpadding...
555
555
DotRadius *= 0.9 ;
556
- var c = AcroForm . Appearance . internal . Bezier_C ;
556
+ // Save results for later use; no need to waste processor ticks on doing math
557
+ var k = DotRadius * 2 ;
558
+ // var c = AcroForm.Appearance.internal.Bezier_C;
559
+ var kc = k * AcroForm . Appearance . internal . Bezier_C ;
560
+ var dc = DotRadius * AcroForm . Appearance . internal . Bezier_C ;
561
+ // stream += "0.749023 g\n\
562
+ // q\n\
563
+ // 1 0 0 1 " + AcroForm.Appearance.internal.getWidth(formObject) / 2 + " " + AcroForm.Appearance.internal.getHeight(formObject) / 2 + " cm\n\
564
+ // " + DotRadius * 2 + " 0 m\n\
565
+ // " + DotRadius * 2 + " " + DotRadius * 2 * c + " " + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 " + DotRadius * 2 + " c\n\
566
+ // -" + DotRadius * 2 * c + " " + DotRadius * 2 + " -" + DotRadius * 2 + " " + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 c\n\
567
+ // -" + DotRadius * 2 + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 -" + DotRadius * 2 + " c\n\
568
+ // " + DotRadius * 2 * c + " -" + DotRadius * 2 + " " + DotRadius * 2 + " -" + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 c\n\
569
+ // f\n\
570
+ // Q\n\
571
+ // 0 g\n\
572
+ // q\n\
573
+ // 1 0 0 1 " + AcroForm.Appearance.internal.getWidth(formObject) / 2 + " " + AcroForm.Appearance.internal.getHeight(formObject) / 2 + " cm\n\
574
+ // " + DotRadius + " 0 m\n\
575
+ // " + DotRadius + " " + DotRadius * c + " " + DotRadius * c + " " + DotRadius + " 0 " + DotRadius + " c\n\
576
+ // -" + DotRadius * c + " " + DotRadius + " -" + DotRadius + " " + DotRadius * c + " -" + DotRadius + " 0 c\n\
577
+ // -" + DotRadius + " -" + DotRadius * c + " -" + DotRadius * c + " -" + DotRadius + " 0 -" + DotRadius + " c\n\
578
+ // " + DotRadius * c + " -" + DotRadius + " " + DotRadius + " -" + DotRadius * c + " " + DotRadius + " 0 c\n\
579
+ // f\n\
580
+ // Q\n";
581
+
582
+ // FASTER VERSION with less processor ticks spent on math operations
557
583
stream += "0.749023 g\n\
558
584
q\n\
559
585
1 0 0 1 " + AcroForm . Appearance . internal . getWidth ( formObject ) / 2 + " " + AcroForm . Appearance . internal . getHeight ( formObject ) / 2 + " cm\n\
560
- " + DotRadius * 2 + " 0 m\n\
561
- " + DotRadius * 2 + " " + DotRadius * 2 * c + " " + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 " + DotRadius * 2 + " c\n\
562
- -" + DotRadius * 2 * c + " " + DotRadius * 2 + " -" + DotRadius * 2 + " " + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 c\n\
563
- -" + DotRadius * 2 + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 -" + DotRadius * 2 + " c\n\
564
- " + DotRadius * 2 * c + " -" + DotRadius * 2 + " " + DotRadius * 2 + " -" + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 c\n\
586
+ " + k + " 0 m\n\
587
+ " + k + " " + kc + " " + kc + " " + k + " 0 " + k + " c\n\
588
+ -" + kc + " " + k + " -" + k + " " + kc + " -" + k + " 0 c\n\
589
+ -" + k + " -" + kc + " -" + kc + " -" + k + " 0 -" + k + " c\n\
590
+ " + kc + " -" + k + " " + k + " -" + kc + " " + k + " 0 c\n\
565
591
f\n\
566
592
Q\n\
567
593
0 g\n\
568
594
q\n\
569
595
1 0 0 1 " + AcroForm . Appearance . internal . getWidth ( formObject ) / 2 + " " + AcroForm . Appearance . internal . getHeight ( formObject ) / 2 + " cm\n\
570
596
" + DotRadius + " 0 m\n\
571
- " + DotRadius + " " + DotRadius * c + " " + DotRadius * c + " " + DotRadius + " 0 " + DotRadius + " c\n\
572
- -" + DotRadius * c + " " + DotRadius + " -" + DotRadius + " " + DotRadius * c + " -" + DotRadius + " 0 c\n\
573
- -" + DotRadius + " -" + DotRadius * c + " -" + DotRadius * c + " -" + DotRadius + " 0 -" + DotRadius + " c\n\
574
- " + DotRadius * c + " -" + DotRadius + " " + DotRadius + " -" + DotRadius * c + " " + DotRadius + " 0 c\n\
597
+ " + DotRadius + " " + dc + " " + dc + " " + DotRadius + " 0 " + DotRadius + " c\n\
598
+ -" + dc + " " + DotRadius + " -" + DotRadius + " " + dc + " -" + DotRadius + " 0 c\n\
599
+ -" + DotRadius + " -" + dc + " -" + dc + " -" + DotRadius + " 0 -" + DotRadius + " c\n\
600
+ " + dc + " -" + DotRadius + " " + DotRadius + " -" + dc + " " + DotRadius + " 0 c\n\
575
601
f\n\
576
602
Q\n" ;
577
603
xobj . stream = stream ;
@@ -584,15 +610,30 @@ Q\n";
584
610
AcroForm . Appearance . internal . getWidth ( formObject ) / 4 : AcroForm . Appearance . internal . getHeight ( formObject ) / 4 ;
585
611
// The Borderpadding...
586
612
DotRadius *= 0.9 ;
587
- var c = AcroForm . Appearance . internal . Bezier_C ;
613
+ // Save results for later use; no need to waste processor ticks on doing math
614
+ var k = DotRadius * 2 ;
615
+ // var c = AcroForm.Appearance.internal.Bezier_C;
616
+ var kc = k * AcroForm . Appearance . internal . Bezier_C ;
617
+ // stream += "0.749023 g\n\
618
+ // q\n\
619
+ // 1 0 0 1 " + AcroForm.Appearance.internal.getWidth(formObject) / 2 + " " + AcroForm.Appearance.internal.getHeight(formObject) / 2 + " cm\n\
620
+ // " + DotRadius * 2 + " 0 m\n\
621
+ // " + DotRadius * 2 + " " + DotRadius * 2 * c + " " + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 " + DotRadius * 2 + " c\n\
622
+ // -" + DotRadius * 2 * c + " " + DotRadius * 2 + " -" + DotRadius * 2 + " " + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 c\n\
623
+ // -" + DotRadius * 2 + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 -" + DotRadius * 2 + " c\n\
624
+ // " + DotRadius * 2 * c + " -" + DotRadius * 2 + " " + DotRadius * 2 + " -" + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 c\n\
625
+ // f\n\
626
+ // Q\n";
627
+
628
+ // FASTER VERSION with less processor ticks spent on math operations
588
629
stream += "0.749023 g\n\
589
630
q\n\
590
631
1 0 0 1 " + AcroForm . Appearance . internal . getWidth ( formObject ) / 2 + " " + AcroForm . Appearance . internal . getHeight ( formObject ) / 2 + " cm\n\
591
- " + DotRadius * 2 + " 0 m\n\
592
- " + DotRadius * 2 + " " + DotRadius * 2 * c + " " + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 " + DotRadius * 2 + " c\n\
593
- -" + DotRadius * 2 * c + " " + DotRadius * 2 + " -" + DotRadius * 2 + " " + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 c\n\
594
- -" + DotRadius * 2 + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 -" + DotRadius * 2 + " c\n\
595
- " + DotRadius * 2 * c + " -" + DotRadius * 2 + " " + DotRadius * 2 + " -" + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 c\n\
632
+ " + k + " 0 m\n\
633
+ " + k + " " + kc + " " + kc + " " + k + " 0 " + k + " c\n\
634
+ -" + kc + " " + k + " -" + k + " " + kc + " -" + k + " 0 c\n\
635
+ -" + k + " -" + kc + " -" + kc + " -" + k + " 0 -" + k + " c\n\
636
+ " + kc + " -" + k + " " + k + " -" + kc + " " + k + " 0 c\n\
596
637
f\n\
597
638
Q\n" ;
598
639
xobj . stream = stream ;
0 commit comments