def update(self): self.cache_pattern_img = None self.cache_ps_pattern_img = None self.cache_gray_pattern_img = None self.cache_paths = self.get_initial_paths() self.cache_cpath = libgeom.create_cpath(self.cache_paths) libgeom.apply_trafo(self.cache_cpath, self.trafo) self.update_bbox()
def update(self): self.cache_cpath = self.get_glyphs() index = 0 for item in self.cache_cpath: if item: if not index in self.trafos: libgeom.apply_trafo(item, self.trafo) else: libgeom.apply_trafo(item, self.trafos[index]) index += 1 self.update_bbox()
def update(self): self.cache_cpath = self.get_glyphs() index = 0 for item in self.cache_cpath: if item: if index not in self.trafos: libgeom.apply_trafo(item, self.trafo) else: libgeom.apply_trafo(item, self.trafos[index]) index += 1 self.update_bbox() if self.style[0]: self.style[0][0] = sk2const.FILL_NONZERO
def apply_trafo(self, trafo): self.cache_cpath = libgeom.apply_trafo(self.cache_cpath, trafo) self.trafo = libgeom.multiply_trafo(self.trafo, trafo) if self.fill_trafo: self.fill_trafo = libgeom.multiply_trafo(self.fill_trafo, trafo) if self.stroke_trafo: self.stroke_trafo = libgeom.multiply_trafo(self.stroke_trafo, trafo) self.update_bbox()
def get_arrow_cpath(arrow, trafo=None): if trafo is None: trafo = sk2const.NORMAL_TRAFO if isinstance(arrow, int): if not ARROWS_CACHE: ARROWS_CACHE.extend([None, ] * len(ARROWS)) if not arrow < len(ARROWS): arrow = 0 if ARROWS_CACHE[arrow] is None: ARROWS_CACHE[arrow] = libgeom.create_cpath(ARROWS[arrow]) return libgeom.apply_trafo(ARROWS_CACHE[arrow], trafo, True) ret = None if arrow and isinstance(arrow, list): try: ret = libgeom.create_cpath(arrow) except Exception: ret = None if ret: return libgeom.apply_trafo(ret, trafo, True) return ret
def apply_trafo(self, trafo): for i in self.trafos.keys(): self.trafos[i] = libgeom.multiply_trafo(self.trafos[i], trafo) for i in range(len(self.cache_cpath)): if self.cache_cpath[i] is None: continue self.cache_cpath[i] = libgeom.apply_trafo(self.cache_cpath[i], trafo) self.trafo = libgeom.multiply_trafo(self.trafo, trafo) if self.fill_trafo: self.fill_trafo = libgeom.multiply_trafo(self.fill_trafo, trafo) if self.stroke_trafo: self.stroke_trafo = libgeom.multiply_trafo(self.stroke_trafo, trafo) self.update_bbox()
def apply_trafo(self, trafo): self.cache_cpath = libgeom.apply_trafo(self.cache_cpath, trafo) self.trafo = libgeom.multiply_trafo(self.trafo, trafo) self.update_bbox()