| 94 | } |
| 95 | |
| 96 | void gradientFromProperty (Graphics &g, Rectangle<int> gradientBounds, const ValueTree &propertyHolder, const Identifier &gradientType, const Identifier &colour1, const Identifier &colour2) |
| 97 | { |
| 98 | if ((int)propertyHolder.getProperty(gradientType) == 1) |
| 99 | { |
| 100 | g.setGradientFill (ColourGradient (VAR2COLOUR(propertyHolder.getProperty(colour1)), |
| 101 | 0.0f, 0.0f, |
| 102 | VAR2COLOUR(propertyHolder.getProperty(colour2)), |
| 103 | 0.0f, (float) gradientBounds.getHeight(), |
| 104 | false)); |
| 105 | } |
| 106 | else if ((int)propertyHolder.getProperty(gradientType) == 2) |
| 107 | { |
| 108 | g.setGradientFill (ColourGradient (VAR2COLOUR(propertyHolder.getProperty(colour1)), |
| 109 | 0.0f, 0.0f, |
| 110 | VAR2COLOUR(propertyHolder.getProperty(colour2)), |
| 111 | (float) gradientBounds.getWidth(), 0.0f, |
| 112 | false)); |
| 113 | } |
| 114 | else if ((int)propertyHolder.getProperty(gradientType) == 3) |
| 115 | { |
| 116 | g.setGradientFill (ColourGradient (VAR2COLOUR(propertyHolder.getProperty(colour1)), |
| 117 | gradientBounds.getWidth()/2.0f, gradientBounds.getHeight()/2.0f, |
| 118 | VAR2COLOUR(propertyHolder.getProperty(colour2)), |
| 119 | 0.0f, 0.0f, |
| 120 | true)); |
| 121 | } |
| 122 | else |
| 123 | { |
| 124 | g.setColour (VAR2COLOUR(propertyHolder.getProperty(colour1))); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | const RectanglePlacement relativePostionFromProperty (const var &positionProperty) |
| 129 | { |
no test coverage detected