mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-28 02:30:05 +00:00
Previously, drawing a mirrored image would produce incorrect results.
Scaling transforms were applied correctly, but mirroring was not. The
following code is an example of a drawing routine that previously
produced incorrect results.
g.fillAll (juce::Colours::grey);
juce::Image image { juce::Image::PixelFormat::ARGB, 512, 512, false };
{
juce::Graphics h { image };
h.setGradientFill (juce::ColourGradient { juce::Colours::cyan,
{},
juce::Colours::magenta,
{ 512, 512 },
false });
h.fillAll();
}
const auto cy = getHeight() / 2;
g.drawImageWithin (image,
0,
0,
getWidth(),
cy,
juce::RectanglePlacement::stretchToFit);
const auto transform = juce::AffineTransform::verticalFlip ((float) cy)
.translated (0, (float) cy);
g.addTransform (transform);
g.drawImageWithin (image,
0,
0,
getWidth(),
cy,
juce::RectanglePlacement::stretchToFit);
|
||
|---|---|---|
| .. | ||
| juce_analytics | ||
| juce_animation | ||
| juce_audio_basics | ||
| juce_audio_devices | ||
| juce_audio_formats | ||
| juce_audio_plugin_client | ||
| juce_audio_processors | ||
| juce_audio_processors_headless | ||
| juce_audio_utils | ||
| juce_box2d | ||
| juce_core | ||
| juce_cryptography | ||
| juce_data_structures | ||
| juce_dsp | ||
| juce_events | ||
| juce_graphics | ||
| juce_gui_basics | ||
| juce_gui_extra | ||
| juce_javascript | ||
| juce_midi_ci | ||
| juce_opengl | ||
| juce_osc | ||
| juce_product_unlocking | ||
| juce_video | ||
| CMakeLists.txt | ||