#NEWLINE# def calc_bezier_curve_range( self , steps , points ) : #NEWLINE# #INDENT# "Hacky method to get an ordered set of points that are on the\n        Bezier curve.  This is used by some backends (which don't support\n        drawing cubic Bezier curves) to render the curve using paths.\n        " #NEWLINE# n = ( len ( points ) - 1 ) #NEWLINE# fact_n = math . factorial ( n ) #NEWLINE# d = OrderedDict ( ) #NEWLINE# m = float ( ( steps - 1 ) ) #NEWLINE# for i in range ( steps ) : #NEWLINE# #INDENT# t = ( i / m ) #NEWLINE# x = y = 0 #NEWLINE# for ( j , pos ) in enumerate ( points ) : #NEWLINE# #INDENT# bin = ( fact_n / float ( ( math . factorial ( j ) * math . factorial ( ( points - j ) ) ) ) ) #NEWLINE# bern = ( ( bin * ( t ** j ) ) * ( ( 1 - t ) ** ( n - j ) ) ) #NEWLINE# x += ( pos [ 0 ] * bern ) #NEWLINE# y += ( pos [ 1 ] * bern ) #NEWLINE# #UNINDENT# d [ ( int ( round ( x ) ) , int ( round ( y ) ) ) ] = None #NEWLINE# #UNINDENT# return list ( d . keys ( ) )