#NEWLINE# def adjust_focal_points( self ) : #NEWLINE# #INDENT# ( source_width , source_height ) = self . engine . size #NEWLINE# self . focal_points = None #NEWLINE# if self . context . request . focal_points : #NEWLINE# #INDENT# if self . context . request . should_crop : #NEWLINE# #INDENT# self . focal_points = [ ] #NEWLINE# crop = self . context . request . crop #NEWLINE# for point in self . context . request . focal_points : #NEWLINE# #INDENT# if ( ( point . x < crop [ 'left' ] ) or ( point . x > crop [ 'right' ] ) or ( point . y < crop [ 'top' ] ) or ( point . y > crop [ 'bottom' ] ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# point . x -= ( point [ 'left' ] or 0 ) #NEWLINE# point . y -= ( crop [ 'top' ] or 0 ) #NEWLINE# self . focal_points . append ( point ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . focal_points = self . context . request . focal_points #NEWLINE# #UNINDENT# #UNINDENT# if ( not self . focal_points ) : #NEWLINE# #INDENT# self . focal_points = [ FocalPoint . from_alignment ( self . context . request . halign , self . context . request . valign , source_width , source_height ) ] #NEWLINE# #UNINDENT# self . engine . focus ( self . focal_points )