Skip to content

Arrows in drawn by the arrow3d are not clipped sometimes #68

@alex-hhh

Description

@alex-hhh

NOTE Pull request #67 introduced the arrow and arrow3d renders

Arrows in drawn by the arrow3d are not clipped when the start is outside the plot area but the end is inside the area. This is visible in the following example: https://github.com/racket/plot/blob/master/plot-test/plot/tests/PRs/test-data/pr42-2-2.png

Source for the test data is at:

(arrows3d '((0 4 0) (2 4 0)) #:color 2 #:width 3 #:label "start OUT, end IN")

This is probably caused by the change here:

(when (and v1 v2 (or draw-outside? (in-bounds? v1)))

When the draw-outside? parameter is #t, the line arrow is drawn even if the start is outside. Note that there is a check there for the end of the arrow, and if the end is outside, the arrow drawing is replaced with put-line which presumably clips the line correctly. We need to add line clipping for the start as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions