diff options
author | =Corey Hulen <corey@hulen.com> | 2015-06-14 23:53:32 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-06-14 23:53:32 -0800 |
commit | 56e74239d6b34df8f30ef046f0b0ff4ff0866a71 (patch) | |
tree | 044da29848cf0f5c8607eac34de69065171669cf /Godeps/_workspace/src/code.google.com/p/draw2d/draw2d/raster/fixed_point.go | |
download | chat-56e74239d6b34df8f30ef046f0b0ff4ff0866a71.tar.gz chat-56e74239d6b34df8f30ef046f0b0ff4ff0866a71.tar.bz2 chat-56e74239d6b34df8f30ef046f0b0ff4ff0866a71.zip |
first commit
Diffstat (limited to 'Godeps/_workspace/src/code.google.com/p/draw2d/draw2d/raster/fixed_point.go')
-rw-r--r-- | Godeps/_workspace/src/code.google.com/p/draw2d/draw2d/raster/fixed_point.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Godeps/_workspace/src/code.google.com/p/draw2d/draw2d/raster/fixed_point.go b/Godeps/_workspace/src/code.google.com/p/draw2d/draw2d/raster/fixed_point.go new file mode 100644 index 000000000..14b8419c3 --- /dev/null +++ b/Godeps/_workspace/src/code.google.com/p/draw2d/draw2d/raster/fixed_point.go @@ -0,0 +1,17 @@ +package raster + +type Fix int32 + +const ( + FIXED_SHIFT = 16 + FIXED_FLOAT_COEF = 1 << FIXED_SHIFT +) + +/*! Fixed point math inevitably introduces rounding error to the DDA. The error is + * fixed every now and then by a separate fix value. The defines below set these. + */ +const ( + SLOPE_FIX_SHIFT = 8 + SLOPE_FIX_STEP = 1 << SLOPE_FIX_SHIFT + SLOPE_FIX_MASK = SLOPE_FIX_STEP - 1 +) |