Make stream commands for diamond line end symbol. "lr" denotes left (False) or right point.
(annot, p1, p2, lr, fill_color)
| 24980 | |
| 24981 | @staticmethod |
| 24982 | def _le_diamond(annot, p1, p2, lr, fill_color): |
| 24983 | """Make stream commands for diamond line end symbol. "lr" denotes left (False) or right point. |
| 24984 | """ |
| 24985 | m, im, L, R, w, scol, fcol, opacity = TOOLS._le_annot_parms(annot, p1, p2, fill_color) |
| 24986 | shift = 2.5 # 2*shift*width = length of square edge |
| 24987 | d = shift * max(1, w) |
| 24988 | M = R - (d/2., 0) if lr else L + (d/2., 0) |
| 24989 | r = Rect(M, M) + (-d, -d, d, d) # the square |
| 24990 | # the square makes line longer by (2*shift - 1)*width |
| 24991 | p = (r.tl + (r.bl - r.tl) * 0.5) * im |
| 24992 | ap = f"q\n{opacity}{p.x:f} {p.y:f} m\n" |
| 24993 | p = (r.tl + (r.tr - r.tl) * 0.5) * im |
| 24994 | ap += f"{p.x:f} {p.y:f} l\n" |
| 24995 | p = (r.tr + (r.br - r.tr) * 0.5) * im |
| 24996 | ap += f"{p.x:f} {p.y:f} l\n" |
| 24997 | p = (r.br + (r.bl - r.br) * 0.5) * im |
| 24998 | ap += f"{p.x:f} {p.y:f} l\n" |
| 24999 | ap += _format_g(w) + " w\n" |
| 25000 | ap += scol + fcol + "b\nQ\n" |
| 25001 | return ap |
| 25002 | |
| 25003 | @staticmethod |
| 25004 | def _le_openarrow(annot, p1, p2, lr, fill_color): |
nothing calls this directly
no test coverage detected