Framing Decision

pyfdl.FramingDecision(label=None, id_=None, framing_intent_id=None, dimensions=None, anchor_point=None, protection_dimensions=None, protection_anchor_point=None)

Bases: Base

adjust_anchor_point(canvas, h_method='center', v_method='center')

Adjust this object's anchor_point either relative to protection_anchor_point or canvas.effective_anchor_point Please note that the h_method and v_method arguments only apply if no protection_anchor_point is present.

Parameters:
  • canvas (Canvas) –

    to fetch anchor point from in case protection_anchor_point is not set

  • h_method (str, default: 'center' ) –

    horizontal alignment ('left', 'center', 'right')

  • v_method (str, default: 'center' ) –

    vertical alignment ('top', 'center', 'bottom')

adjust_protection_anchor_point(canvas, h_method='center', v_method='center')

Adjust this object's protection_anchor_point if protection_dimensions are set. Please note that the h_method and v_method are primarily used when creating a canvas based on a canvas template

Parameters:
  • canvas (Canvas) –

    to fetch anchor point from in case protection_anchor_point is not set

  • h_method (str, default: 'center' ) –

    horizontal alignment ('left', 'center', 'right')

  • v_method (str, default: 'center' ) –

    vertical alignment ('top', 'center', 'bottom')

from_framing_intent(canvas, framing_intent) classmethod

Create a new FramingDecision based on the provided Canvas and FramingIntent

The framing decision's properties are calculated for you. If the canvas has effective dimensions set, these will be used for the calculations. Otherwise, we use the dimensions

Parameters:
  • canvas (Canvas) –

    canvas to base framing decision on

  • framing_intent (FramingIntent) –

    framing intent to place in canvas

Returns: