Ignore:
Timestamp:
2017-07-07T21:27:45+02:00 (7 years ago)
Author:
michael2402
Message:

Fix #14926: Preserve image phase when clamping a line.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/draw/MapViewPath.java

    r12450 r12455  
    254254                length += f;
    255255            }
    256             return visitClippedLine(((BasicStroke) stroke).getDashPhase(), length, consumer);
     256            return visitClippedLine(length, consumer);
    257257        } else {
    258             return visitClippedLine(0, 0, consumer);
     258            return visitClippedLine(0, consumer);
    259259        }
    260260    }
     
    263263     * Visits all straight segments of this path. The segments are clamped to the view.
    264264     * If they are clamped, the start points are aligned with the pattern.
    265      * @param strokeOffset The initial offset of the pattern
    266      * @param strokeLength The dash pattern length. 0 to use no pattern.
     265     * @param strokeLength The dash pattern length. 0 to use no pattern. Only segments of this length will be removed from the line.
    267266     * @param consumer The consumer to call for each segment
    268267     * @return false if visiting the path failed because there e.g. were non-straight segments.
    269268     * @since 11147
    270269     */
    271     public boolean visitClippedLine(double strokeOffset, double strokeLength, PathSegmentConsumer consumer) {
    272         return new ClampingPathVisitor(state.getViewClipRectangle(), strokeOffset, strokeLength, consumer)
     270    public boolean visitClippedLine(double strokeLength, PathSegmentConsumer consumer) {
     271        return new ClampingPathVisitor(state.getViewClipRectangle(), strokeLength, consumer)
    273272            .visit(this);
    274273    }
     
    400399         * Create a new {@link ClampingPathVisitor}
    401400         * @param clip View clip rectangle
    402          * @param strokeOffset Initial stroke offset
    403401         * @param strokeLength Total length of a stroke sequence
    404402         * @param consumer The consumer to notify of the path segments.
    405403         */
    406         ClampingPathVisitor(MapViewRectangle clip, double strokeOffset, double strokeLength, PathSegmentConsumer consumer) {
     404        ClampingPathVisitor(MapViewRectangle clip, double strokeLength, PathSegmentConsumer consumer) {
    407405            this.clip = clip;
    408             this.strokeProgress = Math.min(strokeLength - strokeOffset, 0);
    409406            this.strokeLength = strokeLength;
    410407            this.consumer = consumer;
Note: See TracChangeset for help on using the changeset viewer.