Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Andronov Alexander #208

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Andronov Alexander #208

wants to merge 6 commits into from

Conversation

batyadmx
Copy link

No description provided.

private int segmentsCount = 2;
private List<Vector2> directions = new List<Vector2>();

public Rectangle[] Rectangles => rectangles.Select(Rectangle.Truncate).ToArray();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не используется.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всё ещё на месте.


public class TagCloudLayouter : ITagCloudLayouter
{
private int i;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Очень странное название, надо более говорящее.

private readonly RenderOptions options;
private readonly IColorProvider colorProvider;

private readonly Size imageSize;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно в локальную переменную.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не исправлено.

Comment on lines 51 to 74
private Font GetAdjustedFont(Graphics graphic, string text, Font originalFont, Size boxSize, int maxFontSize, int minFontSize, bool smallestOnFail)
{
for (int adjustedSize = maxFontSize; adjustedSize >= minFontSize; adjustedSize--)
{
Font testFont = new Font(originalFont.Name, adjustedSize, originalFont.Style);

SizeF newSize = graphic.MeasureString(text, testFont);

if (boxSize.Width > Convert.ToInt32(newSize.Width) &&
boxSize.Height > Convert.ToInt32(newSize.Height))
{
return testFont;
}
}

if (smallestOnFail)
{
return new Font(originalFont.Name, minFontSize, originalFont.Style);
}
else
{
return originalFont;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не используется.


public Bitmap Render(WordLayout[] wordLayouts)
{
var rectangles = wordLayouts.Select(x => x.Box).ToArray();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не используется.


public Bitmap CreateCloud(Dictionary<string, int> frequencyDict)
{
var kvps = frequencyDict.OrderByDescending(x => x.Value)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не самое лучшее название для переменной.


foreach (var kvp in kvps)
{
var mul = TagCloudHelpers.GetMultiplier(kvp.Value, minFreq, maxFreq);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Странное стремление к сокращению всего и вся. Что за множитель из контекста непонятно совершенно, надо отразить в названии.

}


private static WordExtractionOptions CreateWordExtractoroptions(Options clOptions)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Опечатка.

{
var radians = angle * Math.PI / 180;
var tangent = Math.Tan(radians);
var x = 1f;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для чего эта переменная?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Окей, в комментах увидел, зачем. Но всё ещё такой же вопрос, зачем нам множитель, равный 1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants