Skip to content

Commit 77e2bd2

Browse files
authored
Merge pull request #3 from Leecason/feature/support_multiline
Feat: support multiline
2 parents c14a505 + 3f481c0 commit 77e2bd2

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ The default global options are:
6868
strokeWidth: 1,
6969
// (in pixels) Padding between the element and roughly where the annotation is drawn.
7070
padding: 5,
71+
// To annotate multiline text (each line separately), set this property to true.
72+
multiline: false,
7173
// By default annotations are drawn in two iterations.
7274
iterations: 2,
7375
}
@@ -181,6 +183,16 @@ Width of the annotation strokes.
181183

182184
Padding between the element and roughly where the annotation is drawn. Default value is `5` (in pixels). If you wish to specify different `top`, `left`, `right`, `bottom` paddings, you can set the value to an array akin to CSS style padding `[top, right, bottom, left]` or just `[top & bottom, left & right]`.
183185

186+
#### multiline
187+
188+
**Type**: `boolean`
189+
190+
**Required**: `false`
191+
192+
**Default**: `false`
193+
194+
This property only applies to inline text. To annotate multiline text (each line separately), set this property to true.
195+
184196
#### iterations
185197

186198
**Type**: `number`

src/components/RoughNotation.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ export default (options) => ({
6161
default: () => options.padding,
6262
},
6363

64+
multiline: {
65+
type: Boolean,
66+
default: () => options.multiline,
67+
},
68+
6469
iterations: {
6570
type: Number,
6671
default: () => options.iterations,
@@ -81,6 +86,7 @@ export default (options) => ({
8186
color: this.color,
8287
strokeWidth: this.strokeWidth,
8388
padding: this.padding,
89+
multiline: this.multiline,
8490
iterations: this.iterations,
8591
});
8692

src/options.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export const defaultOptions = {
1313
// If you wish to specify different top, left, right, bottom paddings,
1414
// you can set the value to an array akin to CSS style padding [top, right, bottom, left] or just [top & bottom, left & right].
1515
padding: 5,
16+
// This property only applies to inline text.
17+
// To annotate multiline text (each line separately), set this property to true.
18+
multiline: false,
1619
// By default annotations are drawn in two iterations,
1720
// e.g.when underlining, drawing from left to right and then back from right to left.
1821
// Setting this property can let you configure the number of iterations.

0 commit comments

Comments
 (0)