-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#203 Improve pattern support #602
base: master
Are you sure you want to change the base?
Conversation
MacawTests/MacawSVGTests.swift
Outdated
} catch { | ||
XCTFail(error.localizedDescription) | ||
return | ||
print(error.localizedDescription) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why XCTFail replaced with print?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, let's separate pattern support and tests improvements.
private let testFolderName = "MacawTestOutputData" | ||
private let shouldComparePNGImages = true | ||
private let multipleTestsWillRun = false | ||
private let shouldSaveFaildedTestImage = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have removed few options in tests. For example, there is no shouldSaveFaildedTestImage
which means that tests can generate some data which is not a good default value.
I would recommend to remove all these changes from this PR to keep it only about pattern support and create another one especially for tests improvements where we can discuss these changes.
Source/model/draw/Pattern.swift
Outdated
public let content: Node | ||
public let bounds: Rect | ||
public let userSpace: Bool | ||
public let position: Transform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename position
to place
.
Source/model/draw/Pattern.swift
Outdated
|
||
public init(content: Node, bounds: Rect, userSpace: Bool = false) { | ||
public init(content: Node, bounds: Rect, viewBox: Rect, userSpace: Bool = false, position: Transform) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to keep in mind that this is a breaking change, because Pattern
is a part of public API. New attributes should always have default value. I'm also not quite sure that viewBox
should have separate attribute, need to think about it.
@@ -150,7 +150,7 @@ open class Image: Node { | |||
} | |||
|
|||
// Base64 image | |||
let decodableFormat = ["image/png", "image/jpg", "image/svg+xml"] | |||
let decodableFormat = ["image/png", "image/jpg", "image/jpeg"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we avoid support for svg images here?
71ea0da
to
c7ff33a
Compare
No description provided.