def GetHandles(self): a = self.properties if self.caret > 0 and self.trafos: # special case to deal with here: the characters that fall # off the end of the path are not visible. If the caret is # in this invisible area, display the caret after the last # visible character caret = 1 index = min(self.caret, len(self.text), len(self.trafos)) - 1 text = self.text[index] trafo = self.trafos[index] else: caret = 0 if self.text and self.trafos: text = self.text[0] trafo = self.trafos[0] else: # XXX fix this self.start_point = self.paths[0].point_at(self.start_pos) return [handle.MakeNodeHandle(self.start_point, 1)] pos, up = a.font.TextCaretData(text, caret, a.font_size, a) pos = trafo(pos) up = trafo.DTransform(up) self.start_point = self.trafos[0].offset() return [ handle.MakeCaretHandle(pos, up), handle.MakeNodeHandle(self.start_point, 1) ]
def GetHandles(self): a = self.properties pos, up = a.font.TextCaretData(self.text, self.caret, a.font_size, a) pos = self.trafo(self.atrafo(pos)) up = self.trafo.DTransform(up) return [handle.MakeCaretHandle(pos, up)]
def GetHandles(self): a = self.properties pos, up = a.font.text_caret_data(self.text, a, self.caret) pos = self.trafo(self.atrafo(pos)) up = self.trafo.DTransform(up) return [handle.MakeCaretHandle(pos, up)]