Skip to content

Commit

Permalink
fix for strict.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
capr committed Apr 25, 2015
1 parent 042ad18 commit b35e222
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
14 changes: 7 additions & 7 deletions path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -776,13 +776,13 @@ local function path_length(path, mt)
return total
end

line_len = require'path_line'.length
quad_curve_len = require'path_bezier2'.length
curve_len = require'path_bezier3'.length
arc_len = require'path_arc'.length
circle_len = require'path_shapes'.circle_length
rect_len = require'path_shapes'.rect_length
round_rect_len = require'path_shapes'.round_rect_length
local line_len = require'path_line'.length
local quad_curve_len = require'path_bezier2'.length
local curve_len = require'path_bezier3'.length
local arc_len = require'path_arc'.length
local circle_len = require'path_shapes'.circle_length
local rect_len = require'path_shapes'.rect_length
local round_rect_len = require'path_shapes'.round_rect_length

function len.move() end

Expand Down
6 changes: 3 additions & 3 deletions path_arc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
--mt is an affine transform that applies to the resulted segments.
--segment_max_sweep is for limiting the arc portion that each bezier segment can cover and is computed automatically.

if not ... then require'path_arc_demo' end

local reflect_point = require'path_point'.reflect_point
local rotate_point = require'path_point'.rotate_point
local hypot = require'path_point'.hypot
Expand Down Expand Up @@ -129,7 +131,7 @@ local function transformed_circle_major_axis(mt, r)
end

--this formula is such that enables a non-oscillating segment-time-to-arc-time at screen resolutions (see demo).
function best_segment_max_sweep(mt, rx, ry)
local function best_segment_max_sweep(mt, rx, ry)
local scale_factor = transformed_circle_major_axis(mt, max(abs(rx), abs(ry))) / 1024
scale_factor = max(scale_factor, 0.1) --cap scale factor so that we don't create sweeps larger than 90 deg.
return sqrt(1/scale_factor^0.6) * 30 --faster way to say 1/2^log10(scale) * 30
Expand Down Expand Up @@ -372,8 +374,6 @@ local function to_arc_3p(cx, cy, rx, ry, start_angle, sweep_angle, rotation, x2,
return x1, y1, xp, yp, x2, y2
end

if not ... then require'path_arc_demo' end

return {
observed_sweep = observed_sweep,
sweep_between = sweep_between,
Expand Down
1 change: 1 addition & 0 deletions path_bezier3_hit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local bezier5_roots
local bezier5_crossing_count
local bezier5_flat_enough
local bezier5_split_in_half
local bezier5_xintercept

--shortest distance-squared from point (x0, y0) to a cubic bezier curve, plus the touch point,
--and the parametric value t on the curve where the touch point splits the curve.
Expand Down

0 comments on commit b35e222

Please sign in to comment.