Fixed: restorePreviousCSSState method for CPColor must be a class method for internal reasons (#2912)

This commit is contained in:
Didier Korthoudt authored and GitHub committed 2020-10-02 10:58:20 +02:00
1 parent 03972f0aec
commit 5724868c5a
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -940,7 +940,7 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image
// You can use -(BOOL)isCSSBased to determine how to cope with it in your code.
// -(BOOL)hasCSSDictionary, -(BOOL)hasCSSBeforeDictionary and -(BOOL)hasCSSAfterDictionary are convience methods you can use.
//
// Remark : -(void)restorePreviousCSSState and -(DOMElement)applyCSSColorForView are meant to be used by low level UI widgets (like CPView) to implement
// Remark : +(void)restorePreviousCSSState and -(DOMElement)applyCSSColorForView are meant to be used by low level UI widgets (like CPView) to implement
// CSS theme support.
@implementation CPColor (CSSTheming)
@@ -999,7 +999,7 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image
return ([_cssAfterDictionary count] > 0);
}
- (void)restorePreviousCSSState:(CPArrayRef)aPreviousStateRef forDOMElement:(DOMElement)aDOMElement
+ (void)restorePreviousCSSState:(CPArrayRef)aPreviousStateRef forDOMElement:(DOMElement)aDOMElement
{
#if PLATFORM(DOM)
var aPreviousState = @deref(aPreviousStateRef);
+1 -1
View File
@@ -1995,7 +1995,7 @@ var CPViewHighDPIDrawingEnabled = YES;
#if PLATFORM(DOM)
if (_backgroundType === BackgroundCSSStyling)
[_backgroundColor restorePreviousCSSState:@ref(_cssStylePreviousState) forDOMElement:_DOMElement];
[CPColor restorePreviousCSSState:@ref(_cssStylePreviousState) forDOMElement:_DOMElement];
var patternImage = [_backgroundColor patternImage],
colorExists = _backgroundColor && ([_backgroundColor patternImage] || [_backgroundColor alphaComponent] > 0.0),