Showing the changes to interface/src/scripting/SelectionScriptingInterface.cpp (1 of 62 files). Show all
Unified · Split
| @@ -421,7 +421,7 @@ bool SelectionHighlightStyle::fromVariantMap(const QVariantMap& properties) { · 420 unmodified lines | ||
| 421 | 421 | auto colorVariant = properties["outlineUnoccludedColor"]; |
| 422 | 422 | if (colorVariant.isValid()) { |
| 423 | 423 | bool isValid; |
| 424 | − auto color = xColorFromVariant(colorVariant, isValid); | |
| 424 | + auto color = vec3FromVariant(colorVariant, isValid); | |
| 425 | 425 | if (isValid) { |
| 426 | 426 | _style._outlineUnoccluded.color = toGlm(color); |
| 427 | 427 | } |
| @@ -429,7 +429,7 @@ bool SelectionHighlightStyle::fromVariantMap(const QVariantMap& properties) { · 1 unmodified line | ||
| 429 | 429 | colorVariant = properties["outlineOccludedColor"]; |
| 430 | 430 | if (colorVariant.isValid()) { |
| 431 | 431 | bool isValid; |
| 432 | − auto color = xColorFromVariant(colorVariant, isValid); | |
| 432 | + auto color = vec3FromVariant(colorVariant, isValid); | |
| 433 | 433 | if (isValid) { |
| 434 | 434 | _style._outlineOccluded.color = toGlm(color); |
| 435 | 435 | } |
| @@ -437,7 +437,7 @@ bool SelectionHighlightStyle::fromVariantMap(const QVariantMap& properties) { · 1 unmodified line | ||
| 437 | 437 | colorVariant = properties["fillUnoccludedColor"]; |
| 438 | 438 | if (colorVariant.isValid()) { |
| 439 | 439 | bool isValid; |
| 440 | − auto color = xColorFromVariant(colorVariant, isValid); | |
| 440 | + auto color = vec3FromVariant(colorVariant, isValid); | |
| 441 | 441 | if (isValid) { |
| 442 | 442 | _style._fillUnoccluded.color = toGlm(color); |
| 443 | 443 | } |
| @@ -445,7 +445,7 @@ bool SelectionHighlightStyle::fromVariantMap(const QVariantMap& properties) { · 1 unmodified line | ||
| 445 | 445 | colorVariant = properties["fillOccludedColor"]; |
| 446 | 446 | if (colorVariant.isValid()) { |
| 447 | 447 | bool isValid; |
| 448 | − auto color = xColorFromVariant(colorVariant, isValid); | |
| 448 | + auto color = vec3FromVariant(colorVariant, isValid); | |
| 449 | 449 | if (isValid) { |
| 450 | 450 | _style._fillOccluded.color = toGlm(color); |
| 451 | 451 | } |
| @@ -482,10 +482,10 @@ bool SelectionHighlightStyle::fromVariantMap(const QVariantMap& properties) { · 30 unmodified lines | ||
| 482 | 482 | |
| 483 | 483 | /**jsdoc |
| 484 | 484 | * @typedef {object} Selection.HighlightStyle |
| 485 | − * @property {Color} outlineUnoccludedColor - Color of the specified highlight region. | |
| 486 | − * @property {Color} outlineOccludedColor - "" | |
| 487 | − * @property {Color} fillUnoccludedColor- "" | |
| 488 | − * @property {Color} fillOccludedColor- "" | |
| 485 | + * @property {Vec3Color} outlineUnoccludedColor - Color of the specified highlight region. | |
| 486 | + * @property {Vec3Color} outlineOccludedColor - "" | |
| 487 | + * @property {Vec3Color} fillUnoccludedColor- "" | |
| 488 | + * @property {Vec3Color} fillOccludedColor- "" | |
| 489 | 489 | * @property {number} outlineUnoccludedAlpha - Alpha value ranging from <code>0.0</code> (not visible) to <code>1.0</code> |
| 490 | 490 | * (fully opaque) for the specified highlight region. |
| 491 | 491 | * @property {number} outlineOccludedAlpha - "" |
| @@ -497,10 +497,11 @@ bool SelectionHighlightStyle::fromVariantMap(const QVariantMap& properties) { · 5 unmodified lines | ||
| 497 | 497 | QVariantMap SelectionHighlightStyle::toVariantMap() const { |
| 498 | 498 | QVariantMap properties; |
| 499 | 499 | |
| 500 | − properties["outlineUnoccludedColor"] = xColorToVariant(xColorFromGlm(_style._outlineUnoccluded.color)); | |
| 501 | − properties["outlineOccludedColor"] = xColorToVariant(xColorFromGlm(_style._outlineOccluded.color)); | |
| 502 | − properties["fillUnoccludedColor"] = xColorToVariant(xColorFromGlm(_style._fillUnoccluded.color)); | |
| 503 | − properties["fillOccludedColor"] = xColorToVariant(xColorFromGlm(_style._fillOccluded.color)); | |
| 500 | + const float MAX_COLOR = 255.0f; | |
| 501 | + properties["outlineUnoccludedColor"] = vec3ToVariant(_style._outlineUnoccluded.color * MAX_COLOR); | |
| 502 | + properties["outlineOccludedColor"] = vec3ToVariant(_style._outlineOccluded.color * MAX_COLOR); | |
| 503 | + properties["fillUnoccludedColor"] = vec3ToVariant(_style._fillUnoccluded.color * MAX_COLOR); | |
| 504 | + properties["fillOccludedColor"] = vec3ToVariant(_style._fillOccluded.color * MAX_COLOR); | |
| 504 | 505 | |
| 505 | 506 | properties["outlineUnoccludedAlpha"] = _style._outlineUnoccluded.alpha; |
| 506 | 507 | properties["outlineOccludedAlpha"] = _style._outlineOccluded.alpha; |