Summary: | Konsole won't allow 10% or 20% transparency | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | V. Augustine <vinay> |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | robertknight |
Priority: | NOR | ||
Version: | 2.2 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | quick fix: call qRound instead of casting to int |
Description
V. Augustine
2009-01-16 20:22:45 UTC
Created attachment 30333 [details]
quick fix: call qRound instead of casting to int
i was unable to test the fix, because I don't have an usable kde build environment set up, but I think i found the issue:
opacity is stored as a floating point number and the operation of muliplying it with 100 and casting it to int sometimes leads to a number one less than is expected - caused by inaccuracy of the floating point number.
why isn't opacity stored as an int? perhaps that would be a better fix.
it can be that <QtGlobal> must be added as an include to make it compile.
SVN commit 912671 by knight: Fix transparently values of 10%, 20% and others not being saved and restored correctly in color scheme editor. Use qRound() on the opacity float instead of (int) cast. Patch by Andre Wisplinghoff BUG:181006 M +1 -1 ColorSchemeEditor.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=912671 > why isn't opacity stored as an int? perhaps that would be a better fix. Qt has two ways of representing alpha - int values from 0 to 255 and floats from 0 to 1. I thought that 0..1 would be easier to understand when reading the code and/or config files. > it can be that <QtGlobal> must be added as an include to make it compile. <QtGlobal> is included by all other Qt includes so any source files which include any Qt or KDE headers will have the declarations from <QtGlobal> available to them. |