From 02b14280e87bf58ec8a559d955c4a59ec183232a Mon Sep 17 00:00:00 2001 From: cormullion Date: Sun, 17 Feb 2019 20:45:14 +0000 Subject: [PATCH] fix bug in rule, misc doc changes --- CHANGELOG.md | 3 ++- README.md | 3 ++- REQUIRE | 1 - docs/src/index.md | 10 ++++++++++ docs/src/text.md | 2 ++ src/basics.jl | 2 +- 6 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a5e9b2b..7f225550 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [v1.2.0] - 2019-02-15 +## [v1.2.0] - 2019-02 ### Added @@ -11,6 +11,7 @@ ### Changed - tried to fix odd bug in `rule(..., π/2)` +- bug in rule() fixed ### Removed diff --git a/README.md b/README.md index 4cf4a786..7a4899d3 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,13 @@ Luxor isn't interactive: for interactive graphics, look at [Gtk.jl](https://gith ## How can you contribute? -If you _know any geometry_ you probably know more than me, so there are plenty of improvements to algorithms waiting to be made. There are some _TODO_s sprinkled through the code, but plenty more opportunities for improvement. +If you _know any geometry_ you probably know more than me, so there are plenty of improvements to algorithms waiting to be made. There are some _TODO_ comments sprinkled through the code, but plenty more opportunities for improvement. _Update the code_, most of which was written for Julia versions 0.2, v0.3 and 0.4 (remember when broadcasting wasn't a thing?) so there are probably many areas where the code could take more advantage of version 1. There can always be _more tests_, as the present tests are mainly visual, showing that something works, but there should be much more testing of things that shouldn't work - inappropriate input, overlapping polygons, coincident or collinear points, anticlockwise polygons, etc. +More _systematic error-handling_ particularly of geometry errors would be a good idea, rather than sprinkling `throw(error())`s around when things look wrong. [docs-latest-img]: https://img.shields.io/badge/docs-latest-blue.svg [docs-latest-url]: http://juliagraphics.github.io/Luxor.jl/latest/ diff --git a/REQUIRE b/REQUIRE index 585ecf6a..6a9df3cc 100644 --- a/REQUIRE +++ b/REQUIRE @@ -2,7 +2,6 @@ julia 0.7 Cairo Juno Colors -Dates FileIO @linux ImageMagick @mac QuartzImageIO diff --git a/docs/src/index.md b/docs/src/index.md index afc0b8c0..6dcbc3e2 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -18,6 +18,16 @@ Luxor isn't interactive: for interactive graphics, look at [Gtk.jl](https://gith Please submit issues and pull requests on [GitHub](https://github.com/JuliaGraphics/Luxor.jl). Original version by [cormullion](https://github.com/cormullion), much improved with contributions from the Julia community. +## How can you contribute? + +If you _know any geometry_ you probably know more than me, so there are plenty of improvements to algorithms waiting to be made. There are some _TODO_ comments sprinkled through the code, but plenty more opportunities for improvement. + +_Update the code_, most of which was written for Julia versions 0.2, v0.3 and 0.4 (remember when broadcasting wasn't a thing?) so there are probably many areas where the code could take more advantage of version 1. + +There can always be _more tests_, as the present tests are mainly visual, showing that something works, but there should be much more testing of things that shouldn't work - inappropriate input, overlapping polygons, coincident or collinear points, anticlockwise polygons, etc. + +More _systematic error-handling_ particularly of geometry errors would be a good idea, rather than sprinkling `throw(error())`s around when things look wrong. + ## Installation and basic usage Install the package using the package manager: diff --git a/docs/src/text.md b/docs/src/text.md index 1438492e..7f70fd6a 100644 --- a/docs/src/text.md +++ b/docs/src/text.md @@ -168,6 +168,8 @@ although typically this lists only those fonts in `/System/Library/Fonts` and `/ In the Pro API, the default font is Times Roman (on macOS). In the Toy API, the default font is Helvetica (on macOS). +One difference between `settext()` and `text()` (on macOS) is that many more missing Unicode glyphs are automatically substituted by other fonts when you use the former. + Cairo (and hence Luxor) doesn't support emoji currently. 😢 ## Text to paths diff --git a/src/basics.jl b/src/basics.jl index deff8c7f..3363f1c9 100644 --- a/src/basics.jl +++ b/src/basics.jl @@ -380,7 +380,7 @@ function rule(pos, theta=0.0; leftside = bbox[1:2] # ruled line could be as long as the diagonal so add a bit extra - r = boxdiagonal(boundingbox)/2 + 10 + r = boxdiagonal(boundingbox) + 10 rcosa = r * cos(theta) rsina = r * sin(theta) ruledline = (pos - (rcosa, rsina), pos + (rcosa, rsina))