polygonprimitive2d.cxx (5aaf853b) | polygonprimitive2d.cxx (88e7420b) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 522 unchanged lines hidden (view full) --- 531 basegfx::B2DPolyPolygon aArrowB; 532 533 if(!aLocalPolygon.isClosed()) 534 { 535 // apply arrows 536 const double fPolyLength(basegfx::tools::getLength(aLocalPolygon)); 537 double fStart(0.0); 538 double fEnd(0.0); | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 522 unchanged lines hidden (view full) --- 531 basegfx::B2DPolyPolygon aArrowB; 532 533 if(!aLocalPolygon.isClosed()) 534 { 535 // apply arrows 536 const double fPolyLength(basegfx::tools::getLength(aLocalPolygon)); 537 double fStart(0.0); 538 double fEnd(0.0); |
539 double fStartOverlap(0.0); 540 double fEndOverlap(0.0); |
|
539 540 if(!getStart().isDefault() && getStart().isActive()) 541 { 542 // create start arrow primitive and consume 543 aArrowA = basegfx::tools::createAreaGeometryForLineStartEnd( 544 aLocalPolygon, getStart().getB2DPolyPolygon(), true, getStart().getWidth(), 545 fPolyLength, getStart().isCentered() ? 0.5 : 0.0, &fStart); 546 | 541 542 if(!getStart().isDefault() && getStart().isActive()) 543 { 544 // create start arrow primitive and consume 545 aArrowA = basegfx::tools::createAreaGeometryForLineStartEnd( 546 aLocalPolygon, getStart().getB2DPolyPolygon(), true, getStart().getWidth(), 547 fPolyLength, getStart().isCentered() ? 0.5 : 0.0, &fStart); 548 |
547 // create some overlapping 548 fStart *= 0.8; | 549 // create some overlapping, compromise between straight and peaked markers 550 // best for marker width 0.3cm and marker line width 0.02cm 551 fStartOverlap = getStart().getWidth() / 15.0; |
549 } 550 551 if(!getEnd().isDefault() && getEnd().isActive()) 552 { 553 // create end arrow primitive and consume 554 aArrowB = basegfx::tools::createAreaGeometryForLineStartEnd( 555 aLocalPolygon, getEnd().getB2DPolyPolygon(), false, getEnd().getWidth(), 556 fPolyLength, getEnd().isCentered() ? 0.5 : 0.0, &fEnd); 557 558 // create some overlapping | 552 } 553 554 if(!getEnd().isDefault() && getEnd().isActive()) 555 { 556 // create end arrow primitive and consume 557 aArrowB = basegfx::tools::createAreaGeometryForLineStartEnd( 558 aLocalPolygon, getEnd().getB2DPolyPolygon(), false, getEnd().getWidth(), 559 fPolyLength, getEnd().isCentered() ? 0.5 : 0.0, &fEnd); 560 561 // create some overlapping |
559 fEnd *= 0.8; | 562 fEndOverlap = getEnd().getWidth() / 15.0; |
560 } 561 562 if(0.0 != fStart || 0.0 != fEnd) 563 { 564 // build new poly, consume something from old poly | 563 } 564 565 if(0.0 != fStart || 0.0 != fEnd) 566 { 567 // build new poly, consume something from old poly |
565 aLocalPolygon = basegfx::tools::getSnippetAbsolute(aLocalPolygon, fStart, fPolyLength - fEnd, fPolyLength); | 568 aLocalPolygon = basegfx::tools::getSnippetAbsolute(aLocalPolygon, fStart-fStartOverlap, fPolyLength - fEnd + fEndOverlap, fPolyLength); |
566 } 567 } 568 569 // prepare return value 570 Primitive2DSequence aRetval(1L + (aArrowA.count() ? 1L : 0L) + (aArrowB.count() ? 1L : 0L)); 571 sal_uInt32 nInd(0L); 572 573 // add shaft --- 84 unchanged lines hidden --- | 569 } 570 } 571 572 // prepare return value 573 Primitive2DSequence aRetval(1L + (aArrowA.count() ? 1L : 0L) + (aArrowB.count() ? 1L : 0L)); 574 sal_uInt32 nInd(0L); 575 576 // add shaft --- 84 unchanged lines hidden --- |