Browse Source

Internal changes to drawable gradients. Fix for AudioFormat bug.

tags/2021-05-28
Julian Storer 15 years ago
parent
commit
d93a3a8ddf
11 changed files with 126 additions and 64 deletions
  1. +12
    -12
      extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.cpp
  2. +2
    -2
      extras/browser plugins/wrapper/juce_ActiveX_GlueCode.cpp
  3. +46
    -19
      juce_amalgamated.cpp
  4. +10
    -6
      juce_amalgamated.h
  5. +1
    -1
      src/audio/audio_file_formats/juce_AudioFormat.cpp
  6. +1
    -1
      src/core/juce_StandardHeader.h
  7. +1
    -0
      src/gui/graphics/contexts/juce_FillType.cpp
  8. +32
    -8
      src/gui/graphics/drawables/juce_Drawable.cpp
  9. +5
    -3
      src/gui/graphics/drawables/juce_Drawable.h
  10. +12
    -10
      src/gui/graphics/drawables/juce_DrawablePath.cpp
  11. +4
    -2
      src/gui/graphics/drawables/juce_DrawablePath.h

+ 12
- 12
extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.cpp View File

@@ -45,7 +45,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title,
{
setTitleBarButtonsRequired (DocumentWindow::minimiseButton | DocumentWindow::closeButton, false);
optionsButton = new TextButton (T("options"));
optionsButton = new TextButton ("options");
Component::addAndMakeVisible (optionsButton);
optionsButton->addButtonListener (this);
optionsButton->setTriggeredOnMouseDown (true);
@@ -68,7 +68,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title,
XmlElement* savedState = 0;
if (globalSettings != 0)
savedState = globalSettings->getXmlValue (T("audioSetup"));
savedState = globalSettings->getXmlValue ("audioSetup");
deviceManager->initialise (filter->getNumInputChannels(),
filter->getNumOutputChannels(),
@@ -81,7 +81,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title,
{
MemoryBlock data;
if (data.fromBase64Encoding (globalSettings->getValue (T("filterState")))
if (data.fromBase64Encoding (globalSettings->getValue ("filterState"))
&& data.getSize() > 0)
{
filter->setStateInformation (data.getData(), data.getSize());
@@ -90,8 +90,8 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title,
setContentComponent (filter->createEditorIfNeeded(), true, true);
const int x = globalSettings->getIntValue (T("windowX"), -100);
const int y = globalSettings->getIntValue (T("windowY"), -100);
const int x = globalSettings->getIntValue ("windowX", -100);
const int y = globalSettings->getIntValue ("windowY", -100);
if (x != -100 && y != -100)
setBoundsConstrained (Rectangle<int> (x, y, getWidth(), getHeight()));
@@ -112,15 +112,15 @@ StandaloneFilterWindow::~StandaloneFilterWindow()
{
PropertySet* const globalSettings = getGlobalSettings();
globalSettings->setValue (T("windowX"), getX());
globalSettings->setValue (T("windowY"), getY());
globalSettings->setValue ("windowX", getX());
globalSettings->setValue ("windowY", getY());
deleteAndZero (optionsButton);
if (globalSettings != 0 && deviceManager != 0)
{
XmlElement* const xml = deviceManager->createStateXml();
globalSettings->setValue (T("audioSetup"), xml);
globalSettings->setValue ("audioSetup", xml);
delete xml;
}
@@ -131,7 +131,7 @@ StandaloneFilterWindow::~StandaloneFilterWindow()
MemoryBlock data;
filter->getStateInformation (data);
globalSettings->setValue (T("filterState"), data.toBase64Encoding());
globalSettings->setValue ("filterState", data.toBase64Encoding());
}
deleteFilter();
@@ -169,7 +169,7 @@ void StandaloneFilterWindow::resetFilter()
PropertySet* const globalSettings = getGlobalSettings();
if (globalSettings != 0)
globalSettings->removeValue (T("filterState"));
globalSettings->removeValue ("filterState");
}
//==============================================================================
@@ -178,7 +178,7 @@ void StandaloneFilterWindow::saveState()
PropertySet* const globalSettings = getGlobalSettings();
FileChooser fc (TRANS("Save current state"),
globalSettings != 0 ? File (globalSettings->getValue (T("lastStateFile")))
globalSettings != 0 ? File (globalSettings->getValue ("lastStateFile"))
: File::nonexistent);
if (fc.browseForFileToSave (true))
@@ -200,7 +200,7 @@ void StandaloneFilterWindow::loadState()
PropertySet* const globalSettings = getGlobalSettings();
FileChooser fc (TRANS("Load a saved state"),
globalSettings != 0 ? File (globalSettings->getValue (T("lastStateFile")))
globalSettings != 0 ? File (globalSettings->getValue ("lastStateFile"))
: File::nonexistent);
if (fc.browseForFileToOpen())


+ 2
- 2
extras/browser plugins/wrapper/juce_ActiveX_GlueCode.cpp View File

@@ -835,7 +835,7 @@ static const String CLSIDToJuceString (REFCLSID clsid)
malloc->Release();
}
return result.removeCharacters (T("{}")).trim();
return result.removeCharacters ("{}").trim();
}
STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID* ppv)
@@ -865,7 +865,7 @@ STDAPI DllCanUnloadNow()
//==============================================================================
static const String makeLegalRegistryName (const String& s)
{
return s.retainCharacters (T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_."));
return s.retainCharacters ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.");
}
static HRESULT doRegistration (const bool unregister)


+ 46
- 19
juce_amalgamated.cpp View File

@@ -19863,7 +19863,7 @@ bool AudioFormatReader::read (int** destSamples,
{
int* lastFullChannel = destSamples[0];

for (int i = numDestChannels; --i > 0;)
for (int i = (int) numChannels; --i > 0;)
{
if (destSamples[i] != 0)
{
@@ -80501,6 +80501,7 @@ FillType::~FillType() throw()
bool FillType::operator== (const FillType& other) const
{
return colour == other.colour && image == other.image
&& transform == other.transform
&& (gradient == other.gradient
|| (gradient != 0 && other.gradient != 0 && *gradient == *other.gradient));
}
@@ -84238,6 +84239,7 @@ const Identifier Drawable::ValueTreeWrapperBase::idProperty ("id");
const Identifier Drawable::ValueTreeWrapperBase::type ("type");
const Identifier Drawable::ValueTreeWrapperBase::gradientPoint1 ("point1");
const Identifier Drawable::ValueTreeWrapperBase::gradientPoint2 ("point2");
const Identifier Drawable::ValueTreeWrapperBase::gradientPoint3 ("point3");
const Identifier Drawable::ValueTreeWrapperBase::colour ("colour");
const Identifier Drawable::ValueTreeWrapperBase::radial ("radial");
const Identifier Drawable::ValueTreeWrapperBase::colours ("colours");
@@ -84266,7 +84268,7 @@ void Drawable::ValueTreeWrapperBase::setID (const String& newID, UndoManager* co
state.setProperty (idProperty, newID, undoManager);
}

const FillType Drawable::ValueTreeWrapperBase::readFillType (const ValueTree& v, RelativePoint* const gp1, RelativePoint* const gp2,
const FillType Drawable::ValueTreeWrapperBase::readFillType (const ValueTree& v, RelativePoint* const gp1, RelativePoint* const gp2, RelativePoint* const gp3,
RelativeCoordinate::NamedCoordinateFinder* const nameFinder, ImageProvider* imageProvider)
{
const String newType (v[type].toString());
@@ -84279,14 +84281,13 @@ const FillType Drawable::ValueTreeWrapperBase::readFillType (const ValueTree& v,
}
else if (newType == "gradient")
{
RelativePoint p1 (v [gradientPoint1]), p2 (v [gradientPoint2]);
RelativePoint p1 (v [gradientPoint1]), p2 (v [gradientPoint2]), p3 (v [gradientPoint3]);

ColourGradient g;

if (gp1 != 0)
*gp1 = p1;
if (gp2 != 0)
*gp2 = p2;
if (gp1 != 0) *gp1 = p1;
if (gp2 != 0) *gp2 = p2;
if (gp3 != 0) *gp3 = p3;

g.point1 = p1.resolve (nameFinder);
g.point2 = p2.resolve (nameFinder);
@@ -84299,7 +84300,20 @@ const FillType Drawable::ValueTreeWrapperBase::readFillType (const ValueTree& v,
g.addColour (colourSteps[i * 2].getDoubleValue(),
Colour ((uint32) colourSteps[i * 2 + 1].getHexValue32()));

return FillType (g);
FillType fillType (g);

if (g.isRadial)
{
const Point<float> point3 (p3.resolve (nameFinder));
const Point<float> point3Source (g.point1.getX() + g.point2.getY() - g.point1.getY(),
g.point1.getY() + g.point1.getX() - g.point2.getX());

fillType.transform = AffineTransform::fromTargetPoints (g.point1.getX(), g.point1.getY(), g.point1.getX(), g.point1.getY(),
g.point2.getX(), g.point2.getY(), g.point2.getX(), g.point2.getY(),
point3Source.getX(), point3Source.getY(), point3.getX(), point3.getY());
}

return fillType;
}
else if (newType == "image")
{
@@ -84316,8 +84330,17 @@ const FillType Drawable::ValueTreeWrapperBase::readFillType (const ValueTree& v,
return FillType();
}

static const Point<float> calcThirdGradientPoint (const FillType& fillType)
{
const ColourGradient& g = *fillType.gradient;
const Point<float> point3Source (g.point1.getX() + g.point2.getY() - g.point1.getY(),
g.point1.getY() + g.point1.getX() - g.point2.getX());

return point3Source.transformedBy (fillType.transform);
}

void Drawable::ValueTreeWrapperBase::writeFillType (ValueTree& v, const FillType& fillType,
const RelativePoint* const gp1, const RelativePoint* const gp2,
const RelativePoint* const gp1, const RelativePoint* const gp2, const RelativePoint* gp3,
ImageProvider* imageProvider, UndoManager* const undoManager)
{
if (fillType.isColour())
@@ -84330,6 +84353,8 @@ void Drawable::ValueTreeWrapperBase::writeFillType (ValueTree& v, const FillType
v.setProperty (type, "gradient", undoManager);
v.setProperty (gradientPoint1, gp1 != 0 ? gp1->toString() : fillType.gradient->point1.toString(), undoManager);
v.setProperty (gradientPoint2, gp2 != 0 ? gp2->toString() : fillType.gradient->point2.toString(), undoManager);
v.setProperty (gradientPoint3, gp3 != 0 ? gp3->toString() : calcThirdGradientPoint (fillType).toString(), undoManager);

v.setProperty (radial, fillType.gradient->isRadial, undoManager);

String s;
@@ -85487,7 +85512,7 @@ ValueTree DrawablePath::ValueTreeWrapper::getMainFillState()
if (v.isValid())
return v;

setMainFill (Colours::black, 0, 0, 0, 0);
setMainFill (Colours::black, 0, 0, 0, 0, 0);
return getMainFillState();
}

@@ -85497,34 +85522,36 @@ ValueTree DrawablePath::ValueTreeWrapper::getStrokeFillState()
if (v.isValid())
return v;

setStrokeFill (Colours::black, 0, 0, 0, 0);
setStrokeFill (Colours::black, 0, 0, 0, 0, 0);
return getStrokeFillState();
}

const FillType DrawablePath::ValueTreeWrapper::getMainFill (RelativeCoordinate::NamedCoordinateFinder* nameFinder,
ImageProvider* imageProvider) const
{
return readFillType (state.getChildWithName (fill), 0, 0, nameFinder, imageProvider);
return readFillType (state.getChildWithName (fill), 0, 0, 0, nameFinder, imageProvider);
}

void DrawablePath::ValueTreeWrapper::setMainFill (const FillType& newFill, const RelativePoint* gp1,
const RelativePoint* gp2, ImageProvider* imageProvider, UndoManager* undoManager)
const RelativePoint* gp2, const RelativePoint* gp3,
ImageProvider* imageProvider, UndoManager* undoManager)
{
ValueTree v (state.getOrCreateChildWithName (fill, undoManager));
writeFillType (v, newFill, gp1, gp2, imageProvider, undoManager);
writeFillType (v, newFill, gp1, gp2, gp3, imageProvider, undoManager);
}

const FillType DrawablePath::ValueTreeWrapper::getStrokeFill (RelativeCoordinate::NamedCoordinateFinder* nameFinder,
ImageProvider* imageProvider) const
{
return readFillType (state.getChildWithName (stroke), 0, 0, nameFinder, imageProvider);
return readFillType (state.getChildWithName (stroke), 0, 0, 0, nameFinder, imageProvider);
}

void DrawablePath::ValueTreeWrapper::setStrokeFill (const FillType& newFill, const RelativePoint* gp1,
const RelativePoint* gp2, ImageProvider* imageProvider, UndoManager* undoManager)
const RelativePoint* gp2, const RelativePoint* gp3,
ImageProvider* imageProvider, UndoManager* undoManager)
{
ValueTree v (state.getOrCreateChildWithName (stroke, undoManager));
writeFillType (v, newFill, gp1, gp2, imageProvider, undoManager);
writeFillType (v, newFill, gp1, gp2, gp3, imageProvider, undoManager);
}

const PathStrokeType DrawablePath::ValueTreeWrapper::getStrokeType() const
@@ -85673,8 +85700,8 @@ const ValueTree DrawablePath::createValueTree (ImageProvider* imageProvider) con
ValueTreeWrapper v (tree);

v.setID (getName(), 0);
v.setMainFill (mainFill, 0, 0, imageProvider, 0);
v.setStrokeFill (strokeFill, 0, 0, imageProvider, 0);
v.setMainFill (mainFill, 0, 0, 0, imageProvider, 0);
v.setStrokeFill (strokeFill, 0, 0, 0, imageProvider, 0);
v.setStrokeType (strokeType, 0);

if (relativePath != 0)


+ 10
- 6
juce_amalgamated.h View File

@@ -64,7 +64,7 @@
*/
#define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 52
#define JUCE_BUILDNUMBER 24
#define JUCE_BUILDNUMBER 25

/** Current Juce version number.

@@ -43362,17 +43362,19 @@ public:
void setID (const String& newID, UndoManager* undoManager);
static const Identifier idProperty;

static const FillType readFillType (const ValueTree& v, RelativePoint* gradientPoint1, RelativePoint* gradientPoint2,
static const FillType readFillType (const ValueTree& v, RelativePoint* gradientPoint1,
RelativePoint* gradientPoint2, RelativePoint* gradientPoint3,
RelativeCoordinate::NamedCoordinateFinder* nameFinder,
ImageProvider* imageProvider);

static void writeFillType (ValueTree& v, const FillType& fillType,
const RelativePoint* gradientPoint1, const RelativePoint* gradientPoint2,
ImageProvider* imageProvider,
const RelativePoint* gradientPoint3, ImageProvider* imageProvider,
UndoManager* undoManager);

ValueTree state;
static const Identifier type, gradientPoint1, gradientPoint2, colour, radial, colours, imageId, imageOpacity;
static const Identifier type, gradientPoint1, gradientPoint2, gradientPoint3,
colour, radial, colours, imageId, imageOpacity;
};

juce_UseDebuggingNewOperator
@@ -59305,13 +59307,15 @@ public:
const FillType getMainFill (RelativeCoordinate::NamedCoordinateFinder* nameFinder,
ImageProvider* imageProvider) const;
ValueTree getMainFillState();
void setMainFill (const FillType& newFill, const RelativePoint* gradientPoint1, const RelativePoint* gradientPoint2,
void setMainFill (const FillType& newFill, const RelativePoint* gradientPoint1,
const RelativePoint* gradientPoint2, const RelativePoint* gradientPoint3,
ImageProvider* imageProvider, UndoManager* undoManager);

const FillType getStrokeFill (RelativeCoordinate::NamedCoordinateFinder* nameFinder,
ImageProvider* imageProvider) const;
ValueTree getStrokeFillState();
void setStrokeFill (const FillType& newFill, const RelativePoint* gradientPoint1, const RelativePoint* gradientPoint2,
void setStrokeFill (const FillType& newFill, const RelativePoint* gradientPoint1,
const RelativePoint* gradientPoint2, const RelativePoint* gradientPoint3,
ImageProvider* imageProvider, UndoManager* undoManager);

const PathStrokeType getStrokeType() const;


+ 1
- 1
src/audio/audio_file_formats/juce_AudioFormat.cpp View File

@@ -85,7 +85,7 @@ bool AudioFormatReader::read (int** destSamples,
{
int* lastFullChannel = destSamples[0];
for (int i = numDestChannels; --i > 0;)
for (int i = (int) numChannels; --i > 0;)
{
if (destSamples[i] != 0)
{


+ 1
- 1
src/core/juce_StandardHeader.h View File

@@ -33,7 +33,7 @@
*/
#define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 52
#define JUCE_BUILDNUMBER 24
#define JUCE_BUILDNUMBER 25
/** Current Juce version number.


+ 1
- 0
src/gui/graphics/contexts/juce_FillType.cpp View File

@@ -79,6 +79,7 @@ FillType::~FillType() throw()
bool FillType::operator== (const FillType& other) const
{
return colour == other.colour && image == other.image
&& transform == other.transform
&& (gradient == other.gradient
|| (gradient != 0 && other.gradient != 0 && *gradient == *other.gradient));
}


+ 32
- 8
src/gui/graphics/drawables/juce_Drawable.cpp View File

@@ -168,6 +168,7 @@ const Identifier Drawable::ValueTreeWrapperBase::idProperty ("id");
const Identifier Drawable::ValueTreeWrapperBase::type ("type");
const Identifier Drawable::ValueTreeWrapperBase::gradientPoint1 ("point1");
const Identifier Drawable::ValueTreeWrapperBase::gradientPoint2 ("point2");
const Identifier Drawable::ValueTreeWrapperBase::gradientPoint3 ("point3");
const Identifier Drawable::ValueTreeWrapperBase::colour ("colour");
const Identifier Drawable::ValueTreeWrapperBase::radial ("radial");
const Identifier Drawable::ValueTreeWrapperBase::colours ("colours");
@@ -196,7 +197,7 @@ void Drawable::ValueTreeWrapperBase::setID (const String& newID, UndoManager* co
state.setProperty (idProperty, newID, undoManager);
}
const FillType Drawable::ValueTreeWrapperBase::readFillType (const ValueTree& v, RelativePoint* const gp1, RelativePoint* const gp2,
const FillType Drawable::ValueTreeWrapperBase::readFillType (const ValueTree& v, RelativePoint* const gp1, RelativePoint* const gp2, RelativePoint* const gp3,
RelativeCoordinate::NamedCoordinateFinder* const nameFinder, ImageProvider* imageProvider)
{
const String newType (v[type].toString());
@@ -209,14 +210,13 @@ const FillType Drawable::ValueTreeWrapperBase::readFillType (const ValueTree& v,
}
else if (newType == "gradient")
{
RelativePoint p1 (v [gradientPoint1]), p2 (v [gradientPoint2]);
RelativePoint p1 (v [gradientPoint1]), p2 (v [gradientPoint2]), p3 (v [gradientPoint3]);
ColourGradient g;
if (gp1 != 0)
*gp1 = p1;
if (gp2 != 0)
*gp2 = p2;
if (gp1 != 0) *gp1 = p1;
if (gp2 != 0) *gp2 = p2;
if (gp3 != 0) *gp3 = p3;
g.point1 = p1.resolve (nameFinder);
g.point2 = p2.resolve (nameFinder);
@@ -229,7 +229,20 @@ const FillType Drawable::ValueTreeWrapperBase::readFillType (const ValueTree& v,
g.addColour (colourSteps[i * 2].getDoubleValue(),
Colour ((uint32) colourSteps[i * 2 + 1].getHexValue32()));
return FillType (g);
FillType fillType (g);
if (g.isRadial)
{
const Point<float> point3 (p3.resolve (nameFinder));
const Point<float> point3Source (g.point1.getX() + g.point2.getY() - g.point1.getY(),
g.point1.getY() + g.point1.getX() - g.point2.getX());
fillType.transform = AffineTransform::fromTargetPoints (g.point1.getX(), g.point1.getY(), g.point1.getX(), g.point1.getY(),
g.point2.getX(), g.point2.getY(), g.point2.getX(), g.point2.getY(),
point3Source.getX(), point3Source.getY(), point3.getX(), point3.getY());
}
return fillType;
}
else if (newType == "image")
{
@@ -246,8 +259,17 @@ const FillType Drawable::ValueTreeWrapperBase::readFillType (const ValueTree& v,
return FillType();
}
static const Point<float> calcThirdGradientPoint (const FillType& fillType)
{
const ColourGradient& g = *fillType.gradient;
const Point<float> point3Source (g.point1.getX() + g.point2.getY() - g.point1.getY(),
g.point1.getY() + g.point1.getX() - g.point2.getX());
return point3Source.transformedBy (fillType.transform);
}
void Drawable::ValueTreeWrapperBase::writeFillType (ValueTree& v, const FillType& fillType,
const RelativePoint* const gp1, const RelativePoint* const gp2,
const RelativePoint* const gp1, const RelativePoint* const gp2, const RelativePoint* gp3,
ImageProvider* imageProvider, UndoManager* const undoManager)
{
if (fillType.isColour())
@@ -260,6 +282,8 @@ void Drawable::ValueTreeWrapperBase::writeFillType (ValueTree& v, const FillType
v.setProperty (type, "gradient", undoManager);
v.setProperty (gradientPoint1, gp1 != 0 ? gp1->toString() : fillType.gradient->point1.toString(), undoManager);
v.setProperty (gradientPoint2, gp2 != 0 ? gp2->toString() : fillType.gradient->point2.toString(), undoManager);
v.setProperty (gradientPoint3, gp3 != 0 ? gp3->toString() : calcThirdGradientPoint (fillType).toString(), undoManager);
v.setProperty (radial, fillType.gradient->isRadial, undoManager);
String s;


+ 5
- 3
src/gui/graphics/drawables/juce_Drawable.h View File

@@ -248,17 +248,19 @@ public:
void setID (const String& newID, UndoManager* undoManager);
static const Identifier idProperty;
static const FillType readFillType (const ValueTree& v, RelativePoint* gradientPoint1, RelativePoint* gradientPoint2,
static const FillType readFillType (const ValueTree& v, RelativePoint* gradientPoint1,
RelativePoint* gradientPoint2, RelativePoint* gradientPoint3,
RelativeCoordinate::NamedCoordinateFinder* nameFinder,
ImageProvider* imageProvider);
static void writeFillType (ValueTree& v, const FillType& fillType,
const RelativePoint* gradientPoint1, const RelativePoint* gradientPoint2,
ImageProvider* imageProvider,
const RelativePoint* gradientPoint3, ImageProvider* imageProvider,
UndoManager* undoManager);
ValueTree state;
static const Identifier type, gradientPoint1, gradientPoint2, colour, radial, colours, imageId, imageOpacity;
static const Identifier type, gradientPoint1, gradientPoint2, gradientPoint3,
colour, radial, colours, imageId, imageOpacity;
};
//==============================================================================


+ 12
- 10
src/gui/graphics/drawables/juce_DrawablePath.cpp View File

@@ -212,7 +212,7 @@ ValueTree DrawablePath::ValueTreeWrapper::getMainFillState()
if (v.isValid())
return v;
setMainFill (Colours::black, 0, 0, 0, 0);
setMainFill (Colours::black, 0, 0, 0, 0, 0);
return getMainFillState();
}
@@ -222,34 +222,36 @@ ValueTree DrawablePath::ValueTreeWrapper::getStrokeFillState()
if (v.isValid())
return v;
setStrokeFill (Colours::black, 0, 0, 0, 0);
setStrokeFill (Colours::black, 0, 0, 0, 0, 0);
return getStrokeFillState();
}
const FillType DrawablePath::ValueTreeWrapper::getMainFill (RelativeCoordinate::NamedCoordinateFinder* nameFinder,
ImageProvider* imageProvider) const
{
return readFillType (state.getChildWithName (fill), 0, 0, nameFinder, imageProvider);
return readFillType (state.getChildWithName (fill), 0, 0, 0, nameFinder, imageProvider);
}
void DrawablePath::ValueTreeWrapper::setMainFill (const FillType& newFill, const RelativePoint* gp1,
const RelativePoint* gp2, ImageProvider* imageProvider, UndoManager* undoManager)
const RelativePoint* gp2, const RelativePoint* gp3,
ImageProvider* imageProvider, UndoManager* undoManager)
{
ValueTree v (state.getOrCreateChildWithName (fill, undoManager));
writeFillType (v, newFill, gp1, gp2, imageProvider, undoManager);
writeFillType (v, newFill, gp1, gp2, gp3, imageProvider, undoManager);
}
const FillType DrawablePath::ValueTreeWrapper::getStrokeFill (RelativeCoordinate::NamedCoordinateFinder* nameFinder,
ImageProvider* imageProvider) const
{
return readFillType (state.getChildWithName (stroke), 0, 0, nameFinder, imageProvider);
return readFillType (state.getChildWithName (stroke), 0, 0, 0, nameFinder, imageProvider);
}
void DrawablePath::ValueTreeWrapper::setStrokeFill (const FillType& newFill, const RelativePoint* gp1,
const RelativePoint* gp2, ImageProvider* imageProvider, UndoManager* undoManager)
const RelativePoint* gp2, const RelativePoint* gp3,
ImageProvider* imageProvider, UndoManager* undoManager)
{
ValueTree v (state.getOrCreateChildWithName (stroke, undoManager));
writeFillType (v, newFill, gp1, gp2, imageProvider, undoManager);
writeFillType (v, newFill, gp1, gp2, gp3, imageProvider, undoManager);
}
const PathStrokeType DrawablePath::ValueTreeWrapper::getStrokeType() const
@@ -401,8 +403,8 @@ const ValueTree DrawablePath::createValueTree (ImageProvider* imageProvider) con
ValueTreeWrapper v (tree);
v.setID (getName(), 0);
v.setMainFill (mainFill, 0, 0, imageProvider, 0);
v.setStrokeFill (strokeFill, 0, 0, imageProvider, 0);
v.setMainFill (mainFill, 0, 0, 0, imageProvider, 0);
v.setStrokeFill (strokeFill, 0, 0, 0, imageProvider, 0);
v.setStrokeType (strokeType, 0);
if (relativePath != 0)


+ 4
- 2
src/gui/graphics/drawables/juce_DrawablePath.h View File

@@ -132,13 +132,15 @@ public:
const FillType getMainFill (RelativeCoordinate::NamedCoordinateFinder* nameFinder,
ImageProvider* imageProvider) const;
ValueTree getMainFillState();
void setMainFill (const FillType& newFill, const RelativePoint* gradientPoint1, const RelativePoint* gradientPoint2,
void setMainFill (const FillType& newFill, const RelativePoint* gradientPoint1,
const RelativePoint* gradientPoint2, const RelativePoint* gradientPoint3,
ImageProvider* imageProvider, UndoManager* undoManager);
const FillType getStrokeFill (RelativeCoordinate::NamedCoordinateFinder* nameFinder,
ImageProvider* imageProvider) const;
ValueTree getStrokeFillState();
void setStrokeFill (const FillType& newFill, const RelativePoint* gradientPoint1, const RelativePoint* gradientPoint2,
void setStrokeFill (const FillType& newFill, const RelativePoint* gradientPoint1,
const RelativePoint* gradientPoint2, const RelativePoint* gradientPoint3,
ImageProvider* imageProvider, UndoManager* undoManager);
const PathStrokeType getStrokeType() const;


Loading…
Cancel
Save