Skip to content

Commit

Permalink
loose the limit
Browse files Browse the repository at this point in the history
  • Loading branch information
dengzq1234 committed Dec 10, 2024
1 parent a88743b commit bbc63f8
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ete4/smartview/renderer/faces.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from ..utils import InvalidUsage, get_random_string
from .draw_helpers import *
from copy import deepcopy

import sys
sys.setrecursionlimit(10000) # Adjust the value as needed
CHAR_HEIGHT = 1.4 # char's height to width ratio

ALLOWED_IMG_EXTENSIONS = [ "png", "svg", "jpeg" ]
Expand Down Expand Up @@ -134,6 +135,7 @@ def compute_bounding_box(self,

self._check_own_content()
x, y = point

dx, dy = size

zx, zy, za = drawer.zoom
Expand Down Expand Up @@ -166,6 +168,7 @@ def compute_bounding_box(self,
avail_dy = dy / n_row
aligned_x = drawer.node_size(drawer.tree)[0]\
if drawer.panel == 0 else drawer.xmin

x = aligned_x + dx_before

if pos == 'aligned_bottom':
Expand All @@ -189,6 +192,10 @@ def compute_bounding_box(self,
max(avail_dx - 2 * padding_x, 0) if avail_dx else None,
max(avail_dy - 2 * padding_y, 0))

# if self.name =="Scale_Face":
# print("Scale_Face")
# print("dx_before", dx_before)
# print(x + padding_x)
return self._box

def fits(self):
Expand Down Expand Up @@ -1460,7 +1467,7 @@ def __init__(self, name='', width=None, color='black',

Face.__init__(self, name=name,
padding_x=padding_x, padding_y=padding_y)

self.name = "Scale_Face"
self.width = width
self.height = None
self.range = scale_range
Expand Down Expand Up @@ -1492,7 +1499,7 @@ def compute_bounding_box(self,

if drawer.TYPE == 'circ' and abs(point[1]) >= pi/2:
pos = swap_pos(pos)

box = super().compute_bounding_box(
drawer,
point, size,
Expand All @@ -1504,6 +1511,7 @@ def compute_bounding_box(self,
dx_before, dy_before)

x, y, _, dy = box

zx, zy = self.zoom

self.viewport = (drawer.viewport.x, drawer.viewport.x + drawer.viewport.dx)
Expand All @@ -1516,6 +1524,7 @@ def compute_bounding_box(self,
y = y + dy - height

self._box = Box(x, y, self.width / zx, height)

return self._box

def draw(self, drawer):
Expand All @@ -1524,6 +1533,7 @@ def draw(self, drawer):

p1 = (x0, y + dy - 5 / zy)
p2 = (x0 + self.width, y + dy - self.vt_line_height / (2 * zy))

if drawer.TYPE == 'circ':
p1 = cartesian(p1)
p2 = cartesian(p2)
Expand All @@ -1532,6 +1542,7 @@ def draw(self, drawer):


nticks = round((self.width * zx) / self.tick_width)

dx = self.width / nticks
range_factor = (self.range[1] - self.range[0]) / self.width

Expand Down

0 comments on commit bbc63f8

Please sign in to comment.