mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Minor DirectWrite fix.
This commit is contained in:
parent
c0b089cae4
commit
a45f14fbdf
4 changed files with 19 additions and 13 deletions
|
|
@ -490,6 +490,8 @@ String::String (const unsigned short number) : text (NumberToStringConverters::c
|
|||
String::String (const int64 number) : text (NumberToStringConverters::createFromInteger (number)) {}
|
||||
String::String (const uint64 number) : text (NumberToStringConverters::createFromInteger (number)) {}
|
||||
|
||||
String::String (const float number) : text (NumberToStringConverters::createFromDouble ((double) number, 0)) {}
|
||||
String::String (const double number) : text (NumberToStringConverters::createFromDouble (number, 0)) {}
|
||||
String::String (const float number, const int numberOfDecimalPlaces) : text (NumberToStringConverters::createFromDouble ((double) number, numberOfDecimalPlaces)) {}
|
||||
String::String (const double number, const int numberOfDecimalPlaces) : text (NumberToStringConverters::createFromDouble (number, numberOfDecimalPlaces)) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -888,63 +888,64 @@ public:
|
|||
// Numeric conversions..
|
||||
|
||||
/** Creates a string containing this signed 32-bit integer as a decimal number.
|
||||
|
||||
@see getIntValue, getFloatValue, getDoubleValue, toHexString
|
||||
*/
|
||||
explicit String (int decimalInteger);
|
||||
|
||||
/** Creates a string containing this unsigned 32-bit integer as a decimal number.
|
||||
|
||||
@see getIntValue, getFloatValue, getDoubleValue, toHexString
|
||||
*/
|
||||
explicit String (unsigned int decimalInteger);
|
||||
|
||||
/** Creates a string containing this signed 16-bit integer as a decimal number.
|
||||
|
||||
@see getIntValue, getFloatValue, getDoubleValue, toHexString
|
||||
*/
|
||||
explicit String (short decimalInteger);
|
||||
|
||||
/** Creates a string containing this unsigned 16-bit integer as a decimal number.
|
||||
|
||||
@see getIntValue, getFloatValue, getDoubleValue, toHexString
|
||||
*/
|
||||
explicit String (unsigned short decimalInteger);
|
||||
|
||||
/** Creates a string containing this signed 64-bit integer as a decimal number.
|
||||
|
||||
@see getLargeIntValue, getFloatValue, getDoubleValue, toHexString
|
||||
*/
|
||||
explicit String (int64 largeIntegerValue);
|
||||
|
||||
/** Creates a string containing this unsigned 64-bit integer as a decimal number.
|
||||
|
||||
@see getLargeIntValue, getFloatValue, getDoubleValue, toHexString
|
||||
*/
|
||||
explicit String (uint64 largeIntegerValue);
|
||||
|
||||
/** Creates a string representing this floating-point number.
|
||||
@param floatValue the value to convert to a string
|
||||
@see getDoubleValue, getIntValue
|
||||
*/
|
||||
explicit String (float floatValue);
|
||||
|
||||
/** Creates a string representing this floating-point number.
|
||||
@param doubleValue the value to convert to a string
|
||||
@see getFloatValue, getIntValue
|
||||
*/
|
||||
explicit String (double doubleValue);
|
||||
|
||||
/** Creates a string representing this floating-point number.
|
||||
@param floatValue the value to convert to a string
|
||||
@param numberOfDecimalPlaces if this is > 0, it will format the number using that many
|
||||
decimal places, and will not use exponent notation. If 0 or
|
||||
less, it will use exponent notation if necessary.
|
||||
@see getDoubleValue, getIntValue
|
||||
*/
|
||||
explicit String (float floatValue,
|
||||
int numberOfDecimalPlaces = 0);
|
||||
String (float floatValue, int numberOfDecimalPlaces);
|
||||
|
||||
/** Creates a string representing this floating-point number.
|
||||
|
||||
@param doubleValue the value to convert to a string
|
||||
@param numberOfDecimalPlaces if this is > 0, it will format the number using that many
|
||||
decimal places, and will not use exponent notation. If 0 or
|
||||
less, it will use exponent notation if necessary.
|
||||
|
||||
@see getFloatValue, getIntValue
|
||||
*/
|
||||
explicit String (double doubleValue,
|
||||
int numberOfDecimalPlaces = 0);
|
||||
String (double doubleValue, int numberOfDecimalPlaces);
|
||||
|
||||
/** Reads the value of the string as a decimal number (up to 32 bits in size).
|
||||
|
||||
|
|
|
|||
|
|
@ -555,7 +555,7 @@ namespace TextLayoutHelpers
|
|||
//==============================================================================
|
||||
void TextLayout::createLayoutWithBalancedLineLengths (const AttributedString& text, float maxWidth)
|
||||
{
|
||||
const float minimumWidth = maxWidth / 2.0;
|
||||
const float minimumWidth = maxWidth / 2.0f;
|
||||
float bestWidth = maxWidth;
|
||||
float bestLineProportion = 0.0f;
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@ namespace DirectWriteTypeLayout
|
|||
lastOriginY = baselineOriginY;
|
||||
++currentLine;
|
||||
|
||||
if (currentLine == layout->getNumLines())
|
||||
return S_OK;
|
||||
|
||||
// The x value is only correct when dealing with LTR text
|
||||
layout->getLine (currentLine).lineOrigin = Point<float> (baselineOriginX, baselineOriginY);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue