diff --git a/Sources/VLSheetView.mm b/Sources/VLSheetView.mm index 52ca927..1156735 100644 --- a/Sources/VLSheetView.mm +++ b/Sources/VLSheetView.mm @@ -628,7 +628,7 @@ const char * sBreak[3] = {"", "\xE2\xA4\xBE", "\xE2\x8E\x98"}; // on top. // if (fSelEnd != kNoMeasure && fSelStart <= fSelEnd - && fLayout->FirstMeasure(system+1) > fSelStart-(fSelStart==fSelEnd) + && fLayout->FirstMeasure(system+1)+(fSelStart==fSelEnd) > fSelStart && fLayout->FirstMeasure(system) < fSelEnd+(fSelStart==fSelEnd) ) [self highlightSelectionForSystem:system]; diff --git a/Sources/VLSheetViewSelection.mm b/Sources/VLSheetViewSelection.mm index 1372d2d..3b50fd2 100644 --- a/Sources/VLSheetViewSelection.mm +++ b/Sources/VLSheetViewSelection.mm @@ -41,7 +41,9 @@ { fView = view; fAnchor = anchor; - [fView selectMeasure:fAnchor to:fAnchor]; + dispatch_async(dispatch_get_main_queue(), ^{ + [fView selectMeasure:fAnchor to:fAnchor]; + }); return self; }