smalruby 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of smalruby might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d355008dbac9c63f8876c8ab9efee1025b5c9c9
4
- data.tar.gz: 684bf5d4b3671176976552fab063f8dfde388e1b
3
+ metadata.gz: e79742c38c61cf25de31f1b89aba03ef25a971a5
4
+ data.tar.gz: 3c62f94a839dfaba9bf2f42c334ceac56516b583
5
5
  SHA512:
6
- metadata.gz: 478a418b73b17492991d66acae73cee020e5330033b03984185f76a765283dff7a3b3394d497b44cfcba6904964dad0aa0f69a33a8b521536e32c1176f612f3e
7
- data.tar.gz: b472e00ec509f4976b62eaec39bc2b157c59382c9b91d3ac2e833fb0fc5a78bc800a91bb622b864ce33f33fa5bcc76b4252963f7ed32b0606f32ca093af033fb
6
+ metadata.gz: de0e92d51cb318d240eeac52dfe18819a0157e0ecbe5681d97f4bf5632df371c107683c6a81bb0e643e12e15b90547cdba134fe280e56f94ddf31e0a1f01db5c
7
+ data.tar.gz: d327022ed04602022b1b25e3089984e5927cdc1744efe2856e021e17750608da0b20422583dd2678630a22601dacdbe1b5d9fcea6a3197c5dd2b5d5348b7d8bb
@@ -125,9 +125,10 @@ module Smalruby
125
125
  @balloon = nil
126
126
  end
127
127
 
128
- return if opts[:message].empty?
128
+ message = opts[:message].to_s
129
+ return if message.empty?
129
130
 
130
- lines = opts[:message].to_s.lines.map { |l| l.scan(/.{1,10}/) }.flatten
131
+ lines = message.to_s.lines.map { |l| l.scan(/.{1,10}/) }.flatten
131
132
  font = new_font(16)
132
133
  width = lines.map { |l| font.get_width(l) }.max
133
134
  height = lines.length * (font.size + 1)
@@ -145,9 +146,11 @@ module Smalruby
145
146
  width + (frame_size + margin_size) + margin_size - 1,
146
147
  height + (frame_size + margin_size) + margin_size - 1,
147
148
  [255, 255, 255])
148
- image.draw_font(frame_size + margin_size,
149
- frame_size + margin_size,
150
- lines.join("\n"), font, [0, 0, 0])
149
+ lines.each.with_index do |line, row|
150
+ image.draw_font(frame_size + margin_size,
151
+ frame_size + margin_size + (font.size + 1) * row,
152
+ line, font, [0, 0, 0])
153
+ end
151
154
  @balloon = Sprite.new(self.x, self.y, image)
152
155
  end
153
156
 
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module Smalruby
4
- VERSION = '0.0.11'
4
+ VERSION = '0.0.12'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smalruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouji Takao