+/** Snap a frame offset within our region using the current snap settings.
+ * @param x Frame offset from this region's position.
+ * @param ensure_snap whether to ignore snap_mode (in the case of SnapOff) and magnetic snap.
+ * Used when inverting snap mode logic with key modifiers, or snap distance calculation.
+ * @return Snapped frame offset from this region's position.
+ */
+MusicFrame
+RegionView::snap_frame_to_frame (frameoffset_t x, bool ensure_snap) const
+{
+ PublicEditor& editor = trackview.editor();
+ /* x is region relative, convert it to global absolute frames */
+ framepos_t const session_frame = x + _region->position();