Skip to content

setBounds is incorrect -- throws away bounds of subsequent diagrams too #13

@fryguybob

Description

@fryguybob

(Imported from http://code.google.com/p/diagrams/issues/detail?id=34. Original issue from [email protected] on June 10, 2011, 05:18:21 AM UTC)

For example, consider

(circle 2 |||
square 1.5 # rotateBy (1/8) # withBounds (square 1 :: Diagram Cairo R2))

which should display a circle next to a slightly overlapping diamond. Instead the output is mostly blank (with a hint of a line on the left).

The problem is that a Forgetful monoid is not the right way to override u annotations traveling up the diagram tree (such as bounds). A Forgetful value ends up annihilating not only u values from below it in the tree, but also any from subtrees to the right.

Perhaps the solution is to allow applying extra u annotations both on the left and the right, then making a special monoid (like Forgetful) that can annihilate a "bracketed" section. A ForgetR value kills values to its right, and ForgetL kills to its left, and when they meet they turn into the identity.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions