return false;
}
+bool Controller::Impl::SetRelativeLineSize(float relativeLineSize)
+{
+ if(std::fabs(relativeLineSize - GetRelativeLineSize()) > Math::MACHINE_EPSILON_1000)
+ {
+ mLayoutEngine.SetRelativeLineSize(relativeLineSize);
+
+ RelayoutAllCharacters();
+ return true;
+ }
+ return false;
+}
+
+float Controller::Impl::GetRelativeLineSize()
+{
+ return mLayoutEngine.GetRelativeLineSize();
+}
+
string Controller::Impl::GetSelectedText()
{
string text;
if(mEventData->mDecorator)
{
- mEventData->mDecorator->SetEditable(editable);
+ bool decoratorEditable = editable && mIsUserInteractionEnabled;
+ mEventData->mDecorator->SetEditable(decoratorEditable);
}
}
}
}
StrikethroughGlyphRun strikethroughGlyphRun;
- strikethroughGlyphRun.color = it->color;
- strikethroughGlyphRun.isColorSet = it->isColorSet;
+ strikethroughGlyphRun.properties = it->properties;
strikethroughGlyphRun.glyphRun.glyphIndex = charactersToGlyph[characterIndex];
strikethroughGlyphRun.glyphRun.numberOfGlyphs = glyphsPerCharacter[characterIndex];
}
}
+void Controller::Impl::CopyCharacterSpacingFromLogicalToVisualModels()
+{
+ //CharacterSpacing character runs from markup-processor
+ const Vector<CharacterSpacingCharacterRun>& characterSpacingCharacterRuns = mModel->mLogicalModel->mCharacterSpacingCharacterRuns;
+ const Vector<GlyphIndex>& charactersToGlyph = mModel->mVisualModel->mCharactersToGlyph;
+ const Vector<Length>& glyphsPerCharacter = mModel->mVisualModel->mGlyphsPerCharacter;
+
+ mModel->mVisualModel->mCharacterSpacingRuns.Clear();
+
+ for(Vector<CharacterSpacingCharacterRun>::ConstIterator it = characterSpacingCharacterRuns.Begin(), endIt = characterSpacingCharacterRuns.End(); it != endIt; ++it)
+ {
+ const CharacterIndex& characterIndex = it->characterRun.characterIndex;
+ const Length& numberOfCharacters = it->characterRun.numberOfCharacters;
+
+ if(numberOfCharacters == 0)
+ {
+ continue;
+ }
+
+ CharacterSpacingGlyphRun characterSpacingGlyphRun;
+ characterSpacingGlyphRun.value = it->value;
+ characterSpacingGlyphRun.glyphRun.glyphIndex = charactersToGlyph[characterIndex];
+ characterSpacingGlyphRun.glyphRun.numberOfGlyphs = glyphsPerCharacter[characterIndex];
+
+ for(Length index = 1u; index < numberOfCharacters; index++)
+ {
+ characterSpacingGlyphRun.glyphRun.numberOfGlyphs += glyphsPerCharacter[characterIndex + index];
+ }
+
+ mModel->mVisualModel->mCharacterSpacingRuns.PushBack(characterSpacingGlyphRun);
+ }
+}
+
void Controller::Impl::SetAutoScrollEnabled(bool enable)
{
if(mLayoutEngine.GetLayout() == Layout::Engine::SINGLE_LINE_BOX)
}
}
+void Controller::Impl::SetUserInteractionEnabled(bool enabled)
+{
+ mIsUserInteractionEnabled = enabled;
+
+ if(mEventData && mEventData->mDecorator)
+ {
+ bool editable = mEventData->mEditingEnabled && enabled;
+ mEventData->mDecorator->SetEditable(editable);
+ }
+}
+
void Controller::Impl::ClearFontData()
{
if(mFontDefaults)