Page MenuHome

Fix T64463: Visual Artifacts with ColorRamp
ClosedPublic

Authored by Harley Acheson (harley) on May 11 2019, 6:18 PM.

Details

Summary

This patch fixes errors reported in T64463 caused by my changes made in this patch.

Sorry for the dumb mistake.

I did test the patch mentioned above before submitting, specifically in the Shader editor, and did not see the visual glitches reported. And still have not been able to recreate the issue as reported. But I do see my error regardless.

ui_draw_but_COLORBAND() is passed a rect to draw inside of. It initializes some local variables for left position and width, and it looked like those were the only vars used for horizontal positioning in the function. So it seemed safe and easy to just alter those. And it behaved as expected when I did so.

However the const rect is later passed to ui_draw_colorband_handle() so my assumption was wrong. And so my initial idea of altering how it draws within the rect was not a good idea.

This patch reverts the changes from that earlier commit and restores ui_draw_but_COLORBAND() to how it was before I played with it. Instead it changes the bounds of the rect before it gets passed as a const to the function. The thing draws perfectly within the bounds sent to it, so this is a smarter, cleaner, and more readable way to do it.

Again, sorry for the error. And yes, tested with Windows 10 at increased display scale.

Diff Detail

Repository
rB Blender

Event Timeline

This revision is now accepted and ready to land.May 11 2019, 9:27 PM
This revision was automatically updated to reflect the committed changes.