pub fn to_width( self, b2w: &HashMap < ByteOffset, WidthOffset > ) -> WidthOffset
	{
		let mut found = WidthOffset( 0 );
		let mut try   = self;

		loop
		{
			if b2w.contains_key( &try )
			{
				found = b2w[ &try ];
				break;
			}

			else if try.0 > 1
			{
				try = try - 1;
			}

			else { break }
		}

		found
	}
// Returns the width of the string up until this ByteOffset. If it falls within a grapheme cluster, the beginning
// of the containing cluster is returned.
//
Returns the width of the string up until this ByteOffset. If it falls within a grapheme cluster, the beginning
of the containing cluster is returned.
Returns the width of the string up until this ByteOffset . If it falls within a grapheme cluster the beginning of the containing cluster is returned .
pub fn to_width( self, b2w: &HashMap < ByteOffset, WidthOffset > ) -> WidthOffset
	{
		let mut found = WidthOffset( 0 );
		let mut try   = self;
		loop
		{
			if b2w.contains_key( &try )
			{
				found = b2w[ &try ];
				break;
			}
			else if try.0 > 1
			{
				try = try - 1;
			}
			else { break }
		}
		found
	}
pub fn to_width ( self , b2w : & HashMap < ByteOffset , WidthOffset > ) -> WidthOffset { let mut found = WidthOffset ( 0 ) ; let mut try = self ; loop { if b2w . contains_key ( & try ) { found = b2w [ & try ] ; break ; } else if try . 0 > 1 { try = try - 1 ; } else { break } } found }
Returns the width of the string up until this ByteOffset.
Returns the width of the string up until this ByteOffset .
self
b2w
&HashMap < ByteOffset, WidthOffset >
self
b2w
&HashMap < ByteOffset, WidthOffset >