Skip to content

#203 Improve pattern support#602

Open
mnndnl wants to merge 10 commits into
masterfrom
fix/203-Improve-pattern-support
Open

#203 Improve pattern support#602
mnndnl wants to merge 10 commits into
masterfrom
fix/203-Improve-pattern-support

Conversation

@mnndnl
Copy link
Copy Markdown
Contributor

@mnndnl mnndnl commented Jun 11, 2019

No description provided.

@ystrot ystrot self-assigned this Jun 14, 2019
@ystrot ystrot added this to the 0.9.6 milestone Jun 14, 2019
Comment thread MacawTests/MacawSVGTests.swift Outdated
} catch {
XCTFail(error.localizedDescription)
return
print(error.localizedDescription)
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member

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
Copy link
Copy Markdown
Member

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.

Comment thread Source/model/draw/Pattern.swift Outdated
public let content: Node
public let bounds: Rect
public let userSpace: Bool
public let position: Transform
Copy link
Copy Markdown
Member

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.

Comment thread Source/model/draw/Pattern.swift Outdated
public let position: Transform

public init(content: Node, bounds: Rect, userSpace: Bool = false) {
public init(content: Node, bounds: Rect, viewBox: Rect, userSpace: Bool = false, position: Transform) {
Copy link
Copy Markdown
Member

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.


// Base64 image
let decodableFormat = ["image/png", "image/jpg", "image/svg+xml"]
let decodableFormat = ["image/png", "image/jpg", "image/jpeg"]
Copy link
Copy Markdown
Member

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?

@mnndnl mnndnl force-pushed the fix/203-Improve-pattern-support branch from 71ea0da to c7ff33a Compare June 14, 2019 09:34
@ystrot ystrot modified the milestones: 0.9.6, 0.9.7 Apr 10, 2020
@ystrot ystrot modified the milestones: 0.9.7, 0.9.x Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants