mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 14:11:35 +02:00
Add point normalization to addAnnotation. (#2914)
This commit is contained in:
committed by
Ian Storm Taylor
parent
2304df2f50
commit
d4b003862d
@@ -429,8 +429,9 @@ class Value extends Record(DEFAULTS) {
|
||||
addAnnotation(annotation) {
|
||||
annotation = Annotation.create(annotation)
|
||||
let value = this
|
||||
let { annotations } = value
|
||||
let { annotations, document } = value
|
||||
const { key } = annotation
|
||||
annotation = annotation.updatePoints(point => point.normalize(document))
|
||||
annotations = annotations.set(key, annotation)
|
||||
value = value.set('annotations', annotations)
|
||||
return value
|
||||
|
Reference in New Issue
Block a user