Module Expr Str ImportFrom alias ImportFrom alias Assign NameStore Num Expr Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assert CompareEq NameLoad Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Str Assign AttributeStore NameLoad attr BinOpAdd BinOpMult NameLoad Num BinOpMult Call NameLoad NameLoad NameLoad Expr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert CompareLtELtE BinOpSub Num NameLoad NameLoad BinOpAdd Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMult NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpSub NameLoad Num Assign NameStore BinOpAdd NameLoad BinOpMult NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert CompareLtELtE BinOpSub Num NameLoad NameLoad BinOpAdd AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpSub NameLoad AttributeLoad NameLoad attr Return BinOpSub AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore BinOpSub NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpSub AttributeLoad NameLoad attr NameLoad If CompareLt NameLoad Num body Assign NameStore Num If CompareGt NameLoad AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert CompareLtELtE BinOpSub Num NameLoad NameLoad BinOpAdd AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr CompareLtE NameLoad NameLoad Assign NameStore Num If NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore BinOpSub NameLoad NameLoad If CompareLt NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore BinOpMult Call NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpSub BinOpDiv BinOpSub NameLoad NameLoad AttributeLoad NameLoad attr Num Assert CompareLtELtE BinOpSub Num NameLoad NameLoad BinOpAdd Num NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr CompareLtELtE Num NameLoad BinOpAdd NameLoad NameLoad If UnaryOpNot NameLoad body Return Num orelse Assign NameStore Num AugAssignAdd NameStore Call NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore CompareLt Call NameLoad BinOpSub NameLoad NameLoad NameLoad If NameLoad body AugAssignAdd NameStore Num orelse AugAssignAdd NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr ListLoad For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd BinOpMult BinOpAdd Num NameLoad AttributeLoad NameLoad attr BinOpMult NameLoad AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A 
Defines the `SnapMap` class.

See its documentation for more info.
 __future__ division python_toolbox misc_tools N/A FUZZ 0.001 N/A 
The fuzziness of floating point numbers.

If two floats have a distance of less than FUZZ, we may treat them as identical.
 SnapMap N/A object N/A N/A 
    Map for deciding which angle the knob will have when mouse-dragging.
    
    
    Here we have three "scales" we are playing in:
    
    1. The "ratio" scale. See documenation on Knob for that one. This controls
       the angle of the knob and the actual value of the final variable.
    
    2. The "y" scale. This is the `y` reading of the mouse on the screen.
    
    3. The "pos" scale. This is a convenient mediator between the first two. It
       is reversed from "y", because on the screen a higher number of y means
       "down", and that's just wrong. Also, it has some translation.
       
     __init__ N/A N/A self snap_point_ratios base_drag_radius snap_point_drag_well initial_y initial_ratio N/A N/A N/A N/A snap_point_ratios N/A sorted snap_point_ratios N/A N/A self snap_point_ratios snap_point_ratios N/A Ordered list of snap points, as ratios. N/A N/A self base_drag_radius base_drag_radius N/A 
        The base drag radius, in pixels.
        
        This number is the basis for calculating the height of the area in which
        the user can play with the mouse to turn the knob. Beyond that area the
        knob will be turned all the way to one side, and any movement farther
        will have no effect.
        
        If there are no snap points, the total height of that area will be `2 *
        self.base_drag_radius`.
         N/A N/A self snap_point_drag_well snap_point_drag_well N/A 
        The height of a snap point's drag well, in pixels.
        
        This is the height of the area on the screen in which, when the user
        drags to it, the knob will have the value of the snap point.
        
        The bigger this is, the harder the snap point "traps" the mouse.
         N/A N/A self initial_y initial_y N/A The y that was recorded when the user started dragging. N/A N/A self initial_ratio initial_ratio N/A The ratio that was recorded when the user started dragging. N/A N/A self initial_pos N/A N/A self ratio_to_pos initial_ratio N/A The pos that was recorded when the user started dragging. N/A N/A self max_pos N/A N/A base_drag_radius 2 N/A N/A len snap_point_ratios snap_point_drag_well N/A The maximum that a pos number can reach before it gets truncated. N/A N/A N/A self _make_snap_point_pos_starts N/A ratio_to_pos N/A N/A self ratio N/A N/A N/A Convert from ratio to pos. N/A N/A N/A -1 FUZZ ratio N/A 1 FUZZ N/A n_snap_points_from_bottom N/A N/A self _get_n_snap_points_from_bottom ratio N/A padding N/A n_snap_points_from_bottom N/A self snap_point_drag_well N/A distance_from_bottom N/A ratio -1 N/A result N/A padding N/A distance_from_bottom N/A self base_drag_radius N/A result N/A pos_to_y N/A N/A self pos N/A N/A N/A Convert from pos to y. N/A N/A N/A 0 FUZZ pos N/A N/A self max_pos FUZZ N/A relative_pos N/A pos N/A self initial_pos N/A N/A N/A self initial_y relative_pos N/A y_to_pos N/A N/A self y N/A N/A N/A Convert from y to pos. N/A relative_y N/A y N/A self initial_y N/A pos N/A N/A self initial_pos relative_y N/A N/A pos 0 N/A N/A pos 0 N/A N/A pos N/A self max_pos N/A N/A pos N/A self max_pos N/A pos N/A pos_to_ratio N/A N/A self pos N/A N/A N/A Convert from pos to ratio. N/A N/A N/A 0 FUZZ pos N/A N/A self max_pos FUZZ N/A snap_point_pos_starts_from_bottom N/A p N/A p N/A self snap_point_pos_starts N/A p pos N/A padding 0 N/A snap_point_pos_starts_from_bottom N/A N/A candidate_for_current_snap_point N/A snap_point_pos_starts_from_bottom N/A -1 N/A distance_from_candidate N/A pos candidate_for_current_snap_point N/A N/A distance_from_candidate N/A self snap_point_drag_well N/A N/A N/A N/A snap_point_pos_starts_from_bottom remove candidate_for_current_snap_point N/A padding distance_from_candidate N/A padding N/A N/A len snap_point_pos_starts_from_bottom N/A self snap_point_drag_well N/A ratio N/A N/A N/A pos padding N/A self base_drag_radius 1 N/A N/A N/A -1 FUZZ ratio N/A 1 FUZZ N/A ratio N/A ratio_to_y N/A N/A self ratio N/A N/A N/A Convert from ratio to y. N/A N/A N/A self pos_to_y N/A N/A self ratio_to_pos ratio N/A y_to_ratio N/A N/A self y N/A N/A N/A Convert from y to ratio. N/A N/A N/A self pos_to_ratio N/A N/A self y_to_pos y N/A _get_n_snap_points_from_bottom N/A N/A self ratio N/A N/A N/A Get the number of snap points whose ratio is lower than `ratio`. N/A raw_list N/A s N/A s N/A self snap_point_ratios N/A -1 s N/A ratio FUZZ N/A N/A raw_list N/A N/A 0 N/A N/A counter 0 N/A counter N/A len N/A raw_list N/A -1 N/A last_snap_point N/A raw_list N/A -1 N/A ratio_in_last_snap_point N/A N/A abs N/A last_snap_point ratio FUZZ N/A ratio_in_last_snap_point N/A N/A counter 0.5 N/A N/A counter 1 N/A counter N/A _make_snap_point_pos_starts N/A N/A self N/A N/A N/A 
        Make a list with a "pos start" for each snap point.
        
        A "pos start" is the lowest point, in pos scale, of a snap point's drag
        well.

        The list is not returned, but is stored as the attribute
        `.snap_point_pos_starts`.
         N/A N/A self snap_point_pos_starts N/A N/A N/A i ratio N/A enumerate N/A self snap_point_ratios N/A N/A N/A N/A N/A self snap_point_pos_starts append N/A N/A N/A 1 ratio N/A self base_drag_radius N/A i N/A self snap_point_drag_well N/A N/A