summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-04-08 16:53:13 -0600
committermo khan <mo@mokhan.ca>2015-04-08 16:53:13 -0600
commit95697b5302e44c0ddf4999a88e8dfec802aa1ecf (patch)
tree6338e371a9063fe43bddb6490ebd85d947d0dce2
parent0479c967ac7edfe627be8d66264ad594f281f956 (diff)
draw some other shapes.
-rw-r--r--app/assets/stylesheets/home.scss5
-rw-r--r--app/models/image.rb21
2 files changed, 17 insertions, 9 deletions
diff --git a/app/assets/stylesheets/home.scss b/app/assets/stylesheets/home.scss
index f0ddc68..992e4ff 100644
--- a/app/assets/stylesheets/home.scss
+++ b/app/assets/stylesheets/home.scss
@@ -1,3 +1,8 @@
// Place all the styles related to the home controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
+
+img {
+ width: 1025px;
+ height: 768px;
+}
diff --git a/app/models/image.rb b/app/models/image.rb
index 707cb0d..ef55ba9 100644
--- a/app/models/image.rb
+++ b/app/models/image.rb
@@ -1,16 +1,19 @@
class Image
def self.find(id)
svg = Scale::SVG.new(width: "100%", height: "100%")
- path = Scale::Path.new
- path.move_to(x: 10, y: 10)
- 10.times do |n|
- path.horizontal(90, relative: true)
- path.vertical(90, relative: true)
- path.horizontal(10, relative: true)
- end
- path.close_path
- svg.add(path)
+ svg.add(Scale::Text.new("HELLO WORLD #{id}", x: 250, y: 250, font_size: 55, font_family: "Verdana"))
+ svg.add(Scale::Path.new.tap do |path|
+ path.move_to(x: 20, y: 1)
+ 10.times do |n|
+ path.horizontal(rand(50), relative: true)
+ path.vertical(rand(50), relative: true)
+ path.horizontal(rand(50), relative: true)
+ end
+ path.close_path
+ end)
+ svg.add(Scale::Circle.new(r: 10, cx: 100, cy: 100))
+ svg.add(Scale::Rectangle.new(width: 10, height: 100, x: 200, y: 200))
svg
end
end