Go で書き直した Ikemen
Revision | ed23f5a21efdf715c8ceb7bf1f764cee0505b05a (tree) |
---|---|
Time | 2017-05-02 18:43:41 |
Author | SUEHIRO <supersuehiro@user...> |
Commiter | SUEHIRO |
AngleDraw の scale の処理を修正
@@ -4141,8 +4141,10 @@ func (sc angleDraw) Run(c *Char, _ []int32) bool { | ||
4141 | 4141 | case angleDraw_value: |
4142 | 4142 | c.angleSet(exp[0].evalF(c)) |
4143 | 4143 | case angleDraw_scale: |
4144 | - c.angleScalse[0] = exp[0].evalF(c) | |
4145 | - c.angleScalse[1] = exp[1].evalF(c) | |
4144 | + c.angleScalse[0] *= exp[0].evalF(c) | |
4145 | + if len(exp) > 1 { | |
4146 | + c.angleScalse[1] *= exp[1].evalF(c) | |
4147 | + } | |
4146 | 4148 | } |
4147 | 4149 | return true |
4148 | 4150 | }) |
@@ -5353,17 +5353,8 @@ func (c *Compiler) angleDraw(is IniSection, sc *StateControllerBase, | ||
5353 | 5353 | angleDraw_value, VT_Float, 1, false); err != nil { |
5354 | 5354 | return err |
5355 | 5355 | } |
5356 | - if err := c.stateParam(is, "scale", func(data string) error { | |
5357 | - bes, err := c.exprs(data, VT_Float, 2) | |
5358 | - if err != nil { | |
5359 | - return err | |
5360 | - } | |
5361 | - if len(bes) < 2 { | |
5362 | - return Error("scaleの要素が足りません") | |
5363 | - } | |
5364 | - sc.add(angleDraw_scale, bes) | |
5365 | - return nil | |
5366 | - }); err != nil { | |
5356 | + if err := c.paramValue(is, sc, "scale", | |
5357 | + angleDraw_scale, VT_Float, 2, false); err != nil { | |
5367 | 5358 | return err |
5368 | 5359 | } |
5369 | 5360 | return nil |