Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if width_hint >= 0:
if d.hug_width != 'ignore':
cns.append((d.width == width_hint) | d.hug_width)
if d.resist_width != 'ignore':
cns.append((d.width >= width_hint) | d.resist_width)
if d.limit_width != 'ignore':
cns.append((d.width <= width_hint) | d.limit_width)
if height_hint >= 0:
if d.hug_height != 'ignore':
cns.append((d.height == height_hint) | d.hug_height)
if d.resist_height != 'ignore':
cns.append((d.height >= height_hint) | d.resist_height)
if d.limit_height != 'ignore':
cns.append((d.height <= height_hint) | d.limit_height)
strength = 0.1 * kiwi.strength.strong
min_width, min_height = self.min_size()
if min_width >= 0:
cns.append((d.width >= min_width) | strength)
if min_height >= 0:
cns.append((d.height >= min_height) | strength)
max_width, max_height = self.max_size()
if max_width >= 0:
cns.append((d.width <= max_width) | strength)
if max_height >= 0:
cns.append((d.height <= max_height) | strength)
return cns