1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-20 06:01:24 +02:00

Add point normalization to addAnnotation. (#2914)

This commit is contained in:
themithy
2019-08-19 18:03:49 +02:00
committed by Ian Storm Taylor
parent 2304df2f50
commit d4b003862d

View File

@@ -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