ea 0.6.53 → 0.6.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '007348c214ad1a2ed4226d46e55a528dafcb12d9e4b5eae9e4d3a3e7d13b5c8c'
4
- data.tar.gz: 7b6af86fe7a76f8661c993b2559345d1538ef5fda6f4fa912f6925be4e4a79f2
3
+ metadata.gz: 4b54f39e2dcdb482e55baad21977878ea11d4325ce84130b5a1be52d94461199
4
+ data.tar.gz: e06fe1f966c7b82cd9a4ee5e0cef8482f5bb83050a74354d10e674b80e6b1317
5
5
  SHA512:
6
- metadata.gz: 4b75f8f3f76d3c4433f147c7f9afba023c84f7961e5c901465c6d237a8775817d130596b4c75714d0bc367bc7605e5db1b356bc8bff2d23a45b723e77deaadf3
7
- data.tar.gz: e6d556ef5bdc04dad2fe196d26114672d7f7b0c9c5e580588279697f3ec5c45538d0fd0729a5847716dd01b98acb64a529aa1d19c38363a99fc307168e5554c6
6
+ metadata.gz: a8c21021bb901b607f7e823bcd5caef4e10343177db98983f450a517c71d3ec929566c9ddc93dde15985bcc2fee88ffe469c164687589325d085bea94abf200d
7
+ data.tar.gz: 538ea960c3033cb4b16fdedccdcc9a27be793e1d6615ad836cd340aec103bca7c86937720e74d925a1f06653939015a8a303ada6a7056a0e7209308fde308fb1
@@ -111,26 +111,27 @@ module Ea
111
111
  value.nil? || value.to_s.empty? ? nil : value
112
112
  end
113
113
 
114
- # EA stores the element font size in tenths of a point in the
115
- # objectstyle string, SHIFTED one point up from what it
116
- # renders: explicit fontsz 100 renders 9pt (0D31AED1: every
117
- # element stores 100, all 321 texts publish at 9pt), 70
118
- # renders 6pt, 140 renders 13pt. 0 means "use default", and
119
- # 80/90 (8pt / 9pt) are EA's classic defaults the dialogs
120
- # write back when the user never customized — such elements
121
- # render at the theme size. Only genuinely custom sizes are
122
- # surfaced as explicit element fonts.
123
- USE_DEFAULT_FONTSZ = [0, 80, 90].freeze
114
+ # EA stores the element font size in tenths of a point and
115
+ # renders it through GDI's double rounding: pixel height =
116
+ # floor(tenths * 96 / 720), then point size =
117
+ # floor(pixels * 72 / 96). 70 -> 9px -> 6pt (F3660305 Text),
118
+ # 80 -> 10px -> 7pt, 90 -> 12px -> 9pt (4EBDE645's PI_*
119
+ # classes), 100 -> 13px -> 9pt (0D31AED1's all-100 elements
120
+ # publish 321 texts at 9pt), 120 -> 16px -> 12pt
121
+ # (412BC89E's Boundary title), 140 -> 18px -> 13pt.
122
+ # fontsz=0 ("use default", written back by the font dialog)
123
+ # renders at the 7pt theme size.
124
+ USE_DEFAULT_FONTSZ = [0].freeze
125
+ GDI_DPI = 96
124
126
 
125
127
  def font_size_from(style_hash)
126
128
  raw = style_hash[:fontsz]
127
129
  return nil if raw.nil? || raw.to_s.empty?
128
130
 
129
- return nil if raw.to_i.zero?
130
-
131
131
  return nil if USE_DEFAULT_FONTSZ.include?(raw.to_i)
132
132
 
133
- (raw.to_f / 10).round - 1
133
+ pixels = (raw.to_f * GDI_DPI / 720).floor
134
+ (pixels * 72.0 / GDI_DPI).floor
134
135
  end
135
136
 
136
137
  def build_connectors(diagram_row)
data/lib/ea/version.rb CHANGED
@@ -4,5 +4,5 @@ module Ea
4
4
  # Gem release version. Extracted to its own file so the
5
5
  # `gem-release` tool's `gem bump` can find and update it via the
6
6
  # standard `lib/<gem>/version.rb` convention.
7
- VERSION = "0.6.53"
7
+ VERSION = "0.6.54"
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.53
4
+ version: 0.6.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.