~ubuntu-branches/debian/sid/latexdraw/sid

« back to all changes in this revision

Viewing changes to latexDraw/figures/Triangle.java

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2009-07-15 23:35:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090715233552-2bblktyf2lmrkyo3
Tags: 2.0.3+1-1
* New upstream release.
* Add additional Recommended packages for new export features.
* Fix typo in long description, with thanks to Kai Weber (Closes: #529195).
* Bump standards to 3.8.2 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
import latexDraw.ui.LaTeXDrawFrame;
15
15
import latexDraw.ui.components.Delimitor;
16
16
import latexDraw.ui.components.MagneticGrid;
 
17
import latexDraw.util.LaTeXDrawNumber;
17
18
import latexDraw.util.LaTeXDrawPoint2D;
18
19
 
19
20
 
442
443
                String addEnd = "";//$NON-NLS-1$
443
444
                LaTeXDrawPoint2D pt1 = borders.getPoint(0), pt2 = borders.getPoint(2);
444
445
                boolean isFilledWasChanged = false;
 
446
                double threshold = 0.001;
445
447
                
446
448
                if(pt1.y>pt2.y || rotationAngle%(Math.PI*2)!=0.)
447
449
                {
464
466
                if(hasShadow)
465
467
                {
466
468
                        fillType+=",shadow=true";//$NON-NLS-1$
467
 
                        fillType+=",shadowangle="+(float)(Math.toDegrees(shadowAngle)-(pt1.y>pt2.y?180:0));//$NON-NLS-1$
 
469
                        fillType+=",shadowangle="+LaTeXDrawNumber.getCutNumber((float)(Math.toDegrees(shadowAngle)-(pt1.y>pt2.y?180:0)),threshold);//$NON-NLS-1$
468
470
                        
469
471
                        if(((float)shadowSize)!=((float)DEFAULT_SHADOW_SIZE))
470
 
                                fillType+=",shadowsize="+(float)(shadowSize/PPC);//$NON-NLS-1$
 
472
                                fillType+=",shadowsize="+LaTeXDrawNumber.getCutNumber((float)(shadowSize/PPC),threshold);//$NON-NLS-1$
471
473
                        
472
474
                        if(!shadowColor.equals(PSTricksConstants.DEFAULT_SHADOW_COLOR))
473
475
                        {
496
498
 
497
499
                if(hasDoubleBoundary)
498
500
                {
499
 
                        add+=",doubleline=true,doublesep="+(float)(doubleSep/ppc); //$NON-NLS-1$
 
501
                        add+=",doubleline=true,doublesep="+LaTeXDrawNumber.getCutNumber((float)(doubleSep/ppc),threshold); //$NON-NLS-1$
500
502
                        
501
503
                        if(doubleColor!=PSTricksConstants.DEFAULT_DOUBLE_COLOR)
502
504
                        {
510
512
                        }
511
513
                }
512
514
                
513
 
                if(Math.abs(baseX) < 0.001) baseX = 0;
514
 
                if(Math.abs(baseY) < 0.001) baseY = 0;
515
515
                if(isFilledWasChanged) isFilled = false;
516
516
                
517
517
                return addBegin+"\\pstriangle[linewidth=" +  //$NON-NLS-1$
518
 
                                  (thickness/ppc ) + add + fillType + "]("  //$NON-NLS-1$
519
 
                                + (baseX/ppc) + ',' + (baseY/ppc) + ")("  //$NON-NLS-1$
520
 
                                + (float)(Math.abs(NW.x-SE.x)/ppc) + ',' 
521
 
                                + (float)(Math.abs(NW.y-SE.y)/ppc) + ')'+addEnd;
 
518
                                LaTeXDrawNumber.getCutNumber(thickness/ppc,threshold) + add + fillType + "]("  //$NON-NLS-1$
 
519
                                + LaTeXDrawNumber.getCutNumber(baseX/ppc, threshold) + ',' + LaTeXDrawNumber.getCutNumber(baseY/ppc, threshold) + ")("  //$NON-NLS-1$
 
520
                                + LaTeXDrawNumber.getCutNumber((float)(Math.abs(NW.x-SE.x)/ppc),threshold) + ',' 
 
521
                                + LaTeXDrawNumber.getCutNumber((float)(Math.abs(NW.y-SE.y)/ppc),threshold) + ')'+addEnd;
522
522
        }
523
523
 
524
524