MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / _le_slash

Method _le_slash

src/__init__.py:25064–25077  ·  view source on GitHub ↗

Make stream commands for slash line end symbol. "lr" denotes left (False) or right point.

(annot, p1, p2, lr, fill_color)

Source from the content-addressed store, hash-verified

25062
25063 @staticmethod
25064 def _le_slash(annot, p1, p2, lr, fill_color):
25065 """Make stream commands for slash line end symbol. "lr" denotes left (False) or right point.
25066 """
25067 m, im, L, R, w, scol, fcol, opacity = TOOLS._le_annot_parms(annot, p1, p2, fill_color)
25068 rw = 1.1547 * max(1, w) * 1.0 # makes rect diagonal a 30 deg inclination
25069 M = R if lr else L
25070 r = Rect(M.x - rw, M.y - 2 * w, M.x + rw, M.y + 2 * w)
25071 top = r.tl * im
25072 bot = r.br * im
25073 ap = f"\nq\n{opacity}{top.x:f} {top.y:f} m\n"
25074 ap += f"{bot.x:f} {bot.y:f} l\n"
25075 ap += _format_g(w) + " w\n"
25076 ap += scol + "s\nQ\n"
25077 return ap
25078
25079 @staticmethod
25080 def _le_square(annot, p1, p2, lr, fill_color):

Callers

nothing calls this directly

Calls 3

RectClass · 0.85
_format_gFunction · 0.85
_le_annot_parmsMethod · 0.80

Tested by

no test coverage detected