[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdegraphics/kolourpaint
From: Clarence Dang <dang () kde ! org>
Date: 2007-10-21 6:39:51
Message-ID: 1192948791.539636.5171.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 727597 by dang:
+much needed APIDoc
M +11 -1 layers/selections/image/kpImageSelectionTransparency.h
M +24 -0 mainWindow/kpMainWindow.h
--- trunk/KDE/kdegraphics/kolourpaint/layers/selections/image/kpImageSelectionTransparency.h \
#727596:727597 @@ -41,10 +41,18 @@
kpImageSelectionTransparency ();
// Selection that's transparent at pixels with <color>
kpImageSelectionTransparency (const kpColor &transparentColor, double \
colorSimilarity); + // If <isOpaque>, <transparentColor> is allowed to be anything
+ // (including invalid) as the color would have no effect.
+ // However, you are encouraged to set it as you would if !<isOpaque>,
+ // because setTransparent(true) might be called later, after which
+ // the <transparentColor> would suddenly become important.
+ //
+ // It is a similar case with <colorSimilarity>, although <colorSimilarity>
+ // must be in-range (see kpColorSimilarityHolder).
kpImageSelectionTransparency (bool isOpaque, const kpColor &transparentColor, \
double colorSimilarity); // Returns whether they are visually equivalent.
// This is the same as a memcmp() except that if they are both opaque,
- // this function will return true regardless of the transaprentColor's.
+ // this function will return true regardless of the transparentColor's.
bool operator== (const kpImageSelectionTransparency &rhs) const;
bool operator!= (const kpImageSelectionTransparency &rhs) const;
~kpImageSelectionTransparency ();
@@ -54,6 +62,8 @@
void setOpaque (bool yes = true);
void setTransparent (bool yes = true);
+ // If isOpaque(), transparentColor() is generally not called because
+ // the transparent color would have no effect.
kpColor transparentColor () const;
void setTransparentColor (const kpColor &transparentColor);
--- trunk/KDE/kdegraphics/kolourpaint/mainWindow/kpMainWindow.h #727596:727597
@@ -236,6 +236,30 @@
public:
kpImageSelectionTransparency imageSelectionTransparency () const;
+ // The drawing background color is set to <transparency>.transparentColor()
+ // if the <transparency> is in Transparent mode or if <forceColorChange>
+ // is true (not the default). [x]
+ //
+ // If <transparency> is in Opaque mode and <forceColorChange> is false,
+ // the background color is not changed because:
+ //
+ // 1. It is ignored by the selection in Opaque mode anyway.
+ // 2. This avoids irritating the user with an unnecessary background
+ // color change.
+ //
+ // The only case where you should set <forceColorChange> to true is in
+ // kpToolImageSelectionTransparencyCommand to ensure that the state
+ // is identical to when the command was constructed.
+ // Later: I don't think setting it to true is ever necessary since:
+ //
+ // 1. The background color only counts in Transparent mode.
+ //
+ // 2. Any kpToolImageSelectionTransparencyCommand that switches to
+ // Transparent mode will automatically set the background
+ // color due to the first part of [x] anyway.
+ //
+ // The other fields of <transparency> are copied into the main window
+ // as expected.
void setImageSelectionTransparency (const kpImageSelectionTransparency \
&transparency, bool forceColorChange = false);
int settingImageSelectionTransparency () const;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic