That’s because Rectangle::fromString is looking for integer tokens, not floats:
/** Parses a string containing a rectangle's details.
The string should contain 4 integer tokens, in the form "x y width height". They
can be comma or whitespace separated.
This method is intended to go with the toString() method, to form an easy way
of saving/loading rectangles as strings.
@see toString
*/
static Rectangle fromString (StringRef stringVersion)
{
StringArray toks;
toks.addTokens (stringVersion.text.findEndOfWhitespace(), ",; \t\r\n", "");
return { parseIntAfterSpace (toks[0]),
parseIntAfterSpace (toks[1]),
parseIntAfterSpace (toks[2]),
parseIntAfterSpace (toks[3]) };
}
Doesn’t appear to be a floating-point version of that.