Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Scaling the image by pixelsPerPoint #885

Merged
merged 2 commits into from
Aug 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ private static void OnProjectWindowItemGUI(string guid, Rect itemRect)
{
var scale = itemRect.height / 90f;
var size = new Vector2(texture.width * scale, texture.height * scale);
size = size / EditorGUIUtility.pixelsPerPoint;
var offset = new Vector2(itemRect.width * Mathf.Min(.4f * scale, .2f), itemRect.height * Mathf.Min(.2f * scale, .2f));
rect = new Rect(itemRect.center.x - size.x * .5f + offset.x, itemRect.center.y - size.y * .5f + offset.y, size.x, size.y);
}
Expand Down